import*as e from"../common/common.js";import*as t from"../platform/platform.js";import{assertNotNullOrUndefined as n}from"../platform/platform.js";import*as r from"../../models/text_utils/text_utils.js";import*as s from"../i18n/i18n.js";import*as i from"../host/host.js";import*as a from"../protocol_client/protocol_client.js";import*as o from"../root/root.js";import*as l from"../../models/trace/trace.js";const d=new Map;class c extends e.ObjectWrapper.ObjectWrapper{#e;constructor(e){super(),this.#e=e}target(){return this.#e}async preSuspendModel(e){}async suspendModel(e){}async resumeModel(){}async postResumeModel(){}dispose(){}static register(e,t){if(t.early&&!t.autostart)throw new Error(`Error registering model ${e.name}: early models must be autostarted.`);d.set(e,t)}static get registeredModels(){return d}}var h=Object.freeze({__proto__:null,SDKModel:c});const u=[{longhands:["animation-delay-start","animation-delay-end"],name:"-alternative-animation-delay"},{longhands:["animation-duration","animation-timing-function","animation-delay-start","animation-delay-end","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name","animation-timeline","animation-range-start","animation-range-end"],name:"-alternative-animation-with-delay-start-end"},{longhands:["animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name","animation-timeline","animation-range-start","animation-range-end"],name:"-alternative-animation-with-timeline"},{inherited:!0,longhands:["white-space-collapse","text-wrap"],name:"-alternative-white-space"},{inherited:!0,name:"-webkit-border-horizontal-spacing"},{name:"-webkit-border-image"},{inherited:!0,name:"-webkit-border-vertical-spacing"},{keywords:["stretch","start","center","end","baseline"],name:"-webkit-box-align"},{keywords:["slice","clone"],name:"-webkit-box-decoration-break"},{inherited:!0,keywords:["normal","reverse"],name:"-webkit-box-direction"},{name:"-webkit-box-flex"},{name:"-webkit-box-ordinal-group"},{keywords:["horizontal","vertical"],name:"-webkit-box-orient"},{keywords:["start","center","end","justify"],name:"-webkit-box-pack"},{name:"-webkit-box-reflect"},{longhands:["break-after"],name:"-webkit-column-break-after"},{longhands:["break-before"],name:"-webkit-column-break-before"},{longhands:["break-inside"],name:"-webkit-column-break-inside"},{inherited:!0,name:"-webkit-font-smoothing"},{inherited:!0,name:"-webkit-highlight"},{inherited:!0,keywords:["auto","loose","normal","strict","after-white-space","anywhere"],name:"-webkit-line-break"},{name:"-webkit-line-clamp"},{inherited:!0,name:"-webkit-locale"},{longhands:["-webkit-mask-image","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-size","-webkit-mask-repeat-x","-webkit-mask-repeat-y","-webkit-mask-origin","-webkit-mask-clip"],name:"-webkit-mask"},{longhands:["-webkit-mask-box-image-source","-webkit-mask-box-image-slice","-webkit-mask-box-image-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat"],name:"-webkit-mask-box-image"},{name:"-webkit-mask-box-image-outset"},{name:"-webkit-mask-box-image-repeat"},{name:"-webkit-mask-box-image-slice"},{name:"-webkit-mask-box-image-source"},{name:"-webkit-mask-box-image-width"},{name:"-webkit-mask-clip"},{name:"-webkit-mask-composite"},{name:"-webkit-mask-image"},{name:"-webkit-mask-origin"},{longhands:["-webkit-mask-position-x","-webkit-mask-position-y"],name:"-webkit-mask-position"},{name:"-webkit-mask-position-x"},{name:"-webkit-mask-position-y"},{longhands:["-webkit-mask-repeat-x","-webkit-mask-repeat-y"],name:"-webkit-mask-repeat"},{name:"-webkit-mask-repeat-x"},{name:"-webkit-mask-repeat-y"},{name:"-webkit-mask-size"},{name:"-webkit-perspective-origin-x"},{name:"-webkit-perspective-origin-y"},{inherited:!0,keywords:["economy","exact"],name:"-webkit-print-color-adjust"},{inherited:!0,keywords:["logical","visual"],name:"-webkit-rtl-ordering"},{inherited:!0,keywords:["before","after"],name:"-webkit-ruby-position"},{inherited:!0,name:"-webkit-tap-highlight-color"},{inherited:!0,name:"-webkit-text-combine"},{inherited:!0,name:"-webkit-text-decorations-in-effect"},{inherited:!0,name:"-webkit-text-fill-color"},{inherited:!0,name:"-webkit-text-orientation"},{inherited:!0,keywords:["none","disc","circle","square"],name:"-webkit-text-security"},{inherited:!0,longhands:["-webkit-text-stroke-width","-webkit-text-stroke-color"],name:"-webkit-text-stroke"},{inherited:!0,name:"-webkit-text-stroke-color"},{inherited:!0,name:"-webkit-text-stroke-width"},{name:"-webkit-transform-origin-x"},{name:"-webkit-transform-origin-y"},{name:"-webkit-transform-origin-z"},{keywords:["auto","none","element"],name:"-webkit-user-drag"},{inherited:!0,keywords:["read-only","read-write","read-write-plaintext-only"],name:"-webkit-user-modify"},{inherited:!0,name:"-webkit-writing-mode"},{inherited:!0,keywords:["auto","currentcolor"],name:"accent-color"},{name:"additive-symbols"},{name:"align-content"},{name:"align-items"},{name:"align-self"},{keywords:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"],name:"alignment-baseline"},{name:"all"},{keywords:["none"],name:"anchor-default"},{keywords:["none"],name:"anchor-name"},{keywords:["none"],name:"anchor-scroll"},{longhands:["animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name"],name:"animation"},{keywords:["replace","add","accumulate"],name:"animation-composition"},{name:"animation-delay"},{name:"animation-delay-end"},{name:"animation-delay-start"},{keywords:["normal","reverse","alternate","alternate-reverse"],name:"animation-direction"},{name:"animation-duration"},{keywords:["none","forwards","backwards","both"],name:"animation-fill-mode"},{keywords:["infinite"],name:"animation-iteration-count"},{keywords:["none"],name:"animation-name"},{keywords:["running","paused"],name:"animation-play-state"},{longhands:["animation-range-start","animation-range-end"],name:"animation-range"},{name:"animation-range-end"},{name:"animation-range-start"},{keywords:["none","auto"],name:"animation-timeline"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"animation-timing-function"},{keywords:["none","drag","no-drag"],name:"app-region"},{name:"appearance"},{name:"ascent-override"},{keywords:["auto"],name:"aspect-ratio"},{keywords:["none"],name:"backdrop-filter"},{keywords:["visible","hidden"],name:"backface-visibility"},{longhands:["background-image","background-position-x","background-position-y","background-size","background-repeat-x","background-repeat-y","background-attachment","background-origin","background-clip","background-color"],name:"background"},{keywords:["scroll","fixed","local"],name:"background-attachment"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],name:"background-blend-mode"},{keywords:["border-box","padding-box","content-box"],name:"background-clip"},{keywords:["currentcolor"],name:"background-color"},{keywords:["auto","none"],name:"background-image"},{keywords:["border-box","padding-box","content-box"],name:"background-origin"},{longhands:["background-position-x","background-position-y"],name:"background-position"},{name:"background-position-x"},{name:"background-position-y"},{longhands:["background-repeat-x","background-repeat-y"],name:"background-repeat"},{name:"background-repeat-x"},{name:"background-repeat-y"},{keywords:["auto","cover","contain"],name:"background-size"},{name:"base-palette"},{keywords:["baseline","sub","super"],name:"baseline-shift"},{keywords:["auto","first","last"],name:"baseline-source"},{keywords:["auto"],name:"block-size"},{longhands:["border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border"},{longhands:["border-block-start-color","border-block-start-style","border-block-start-width","border-block-end-color","border-block-end-style","border-block-end-width"],name:"border-block"},{longhands:["border-block-start-color","border-block-end-color"],name:"border-block-color"},{longhands:["border-block-end-width","border-block-end-style","border-block-end-color"],name:"border-block-end"},{name:"border-block-end-color"},{name:"border-block-end-style"},{name:"border-block-end-width"},{longhands:["border-block-start-width","border-block-start-style","border-block-start-color"],name:"border-block-start"},{name:"border-block-start-color"},{name:"border-block-start-style"},{name:"border-block-start-width"},{longhands:["border-block-start-style","border-block-end-style"],name:"border-block-style"},{longhands:["border-block-start-width","border-block-end-width"],name:"border-block-width"},{longhands:["border-bottom-width","border-bottom-style","border-bottom-color"],name:"border-bottom"},{keywords:["currentcolor"],name:"border-bottom-color"},{name:"border-bottom-left-radius"},{name:"border-bottom-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-bottom-style"},{keywords:["thin","medium","thick"],name:"border-bottom-width"},{inherited:!0,keywords:["separate","collapse"],name:"border-collapse"},{longhands:["border-top-color","border-right-color","border-bottom-color","border-left-color"],name:"border-color"},{name:"border-end-end-radius"},{name:"border-end-start-radius"},{longhands:["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border-image"},{name:"border-image-outset"},{keywords:["stretch","repeat","round","space"],name:"border-image-repeat"},{name:"border-image-slice"},{keywords:["none"],name:"border-image-source"},{keywords:["auto"],name:"border-image-width"},{longhands:["border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-end-color","border-inline-end-style","border-inline-end-width"],name:"border-inline"},{longhands:["border-inline-start-color","border-inline-end-color"],name:"border-inline-color"},{longhands:["border-inline-end-width","border-inline-end-style","border-inline-end-color"],name:"border-inline-end"},{name:"border-inline-end-color"},{name:"border-inline-end-style"},{name:"border-inline-end-width"},{longhands:["border-inline-start-width","border-inline-start-style","border-inline-start-color"],name:"border-inline-start"},{name:"border-inline-start-color"},{name:"border-inline-start-style"},{name:"border-inline-start-width"},{longhands:["border-inline-start-style","border-inline-end-style"],name:"border-inline-style"},{longhands:["border-inline-start-width","border-inline-end-width"],name:"border-inline-width"},{longhands:["border-left-width","border-left-style","border-left-color"],name:"border-left"},{keywords:["currentcolor"],name:"border-left-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-left-style"},{keywords:["thin","medium","thick"],name:"border-left-width"},{longhands:["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],name:"border-radius"},{longhands:["border-right-width","border-right-style","border-right-color"],name:"border-right"},{keywords:["currentcolor"],name:"border-right-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-right-style"},{keywords:["thin","medium","thick"],name:"border-right-width"},{inherited:!0,longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing"],name:"border-spacing"},{name:"border-start-end-radius"},{name:"border-start-start-radius"},{keywords:["none"],longhands:["border-top-style","border-right-style","border-bottom-style","border-left-style"],name:"border-style"},{longhands:["border-top-width","border-top-style","border-top-color"],name:"border-top"},{keywords:["currentcolor"],name:"border-top-color"},{name:"border-top-left-radius"},{name:"border-top-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-top-style"},{keywords:["thin","medium","thick"],name:"border-top-width"},{longhands:["border-top-width","border-right-width","border-bottom-width","border-left-width"],name:"border-width"},{keywords:["auto"],name:"bottom"},{keywords:["none"],name:"box-shadow"},{keywords:["content-box","border-box"],name:"box-sizing"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-after"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-before"},{keywords:["auto","avoid","avoid-column","avoid-page"],name:"break-inside"},{keywords:["auto","dynamic","static"],name:"buffered-rendering"},{inherited:!0,keywords:["top","bottom"],name:"caption-side"},{inherited:!0,keywords:["auto","currentcolor"],name:"caret-color"},{keywords:["none","left","right","both","inline-start","inline-end"],name:"clear"},{keywords:["auto"],name:"clip"},{keywords:["none"],name:"clip-path"},{inherited:!0,keywords:["nonzero","evenodd"],name:"clip-rule"},{inherited:!0,keywords:["currentcolor"],name:"color"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation-filters"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality"],name:"color-rendering"},{inherited:!0,name:"color-scheme"},{keywords:["auto"],name:"column-count"},{keywords:["balance","auto"],name:"column-fill"},{keywords:["normal"],name:"column-gap"},{longhands:["column-rule-width","column-rule-style","column-rule-color"],name:"column-rule"},{keywords:["currentcolor"],name:"column-rule-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"column-rule-style"},{keywords:["thin","medium","thick"],name:"column-rule-width"},{keywords:["none","all"],name:"column-span"},{keywords:["auto"],name:"column-width"},{longhands:["column-width","column-count"],name:"columns"},{keywords:["none","strict","content","size","layout","style","paint","inline-size","block-size"],name:"contain"},{name:"contain-intrinsic-block-size"},{keywords:["auto","none"],name:"contain-intrinsic-height"},{name:"contain-intrinsic-inline-size"},{longhands:["contain-intrinsic-width","contain-intrinsic-height"],name:"contain-intrinsic-size"},{keywords:["auto","none"],name:"contain-intrinsic-width"},{longhands:["container-name","container-type"],name:"container"},{keywords:["none"],name:"container-name"},{keywords:["normal","inline-size","size","sticky"],name:"container-type"},{name:"content"},{keywords:["visible","auto","hidden"],name:"content-visibility"},{keywords:["none"],name:"counter-increment"},{keywords:["none"],name:"counter-reset"},{keywords:["none"],name:"counter-set"},{inherited:!0,keywords:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"],name:"cursor"},{name:"cx"},{name:"cy"},{keywords:["none"],name:"d"},{name:"descent-override"},{inherited:!0,keywords:["ltr","rtl"],name:"direction"},{keywords:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math"],name:"display"},{inherited:!0,keywords:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"],name:"dominant-baseline"},{inherited:!0,keywords:["show","hide"],name:"empty-cells"},{name:"fallback"},{inherited:!0,name:"fill"},{inherited:!0,name:"fill-opacity"},{inherited:!0,keywords:["nonzero","evenodd"],name:"fill-rule"},{keywords:["none"],name:"filter"},{longhands:["flex-grow","flex-shrink","flex-basis"],name:"flex"},{keywords:["auto","fit-content","min-content","max-content","content"],name:"flex-basis"},{keywords:["row","row-reverse","column","column-reverse"],name:"flex-direction"},{longhands:["flex-direction","flex-wrap"],name:"flex-flow"},{name:"flex-grow"},{name:"flex-shrink"},{keywords:["nowrap","wrap","wrap-reverse"],name:"flex-wrap"},{keywords:["none","left","right","inline-start","inline-end"],name:"float"},{keywords:["currentcolor"],name:"flood-color"},{name:"flood-opacity"},{inherited:!0,longhands:["font-style","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-alternates","font-variant-position","font-weight","font-stretch","font-size","line-height","font-family","font-optical-sizing","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings"],name:"font"},{name:"font-display"},{inherited:!0,name:"font-family"},{inherited:!0,keywords:["normal"],name:"font-feature-settings"},{inherited:!0,keywords:["auto","normal","none"],name:"font-kerning"},{inherited:!0,keywords:["auto","none"],name:"font-optical-sizing"},{inherited:!0,keywords:["normal","light","dark"],name:"font-palette"},{inherited:!0,keywords:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"],name:"font-size"},{inherited:!0,keywords:["none","ex-height","cap-height","ch-width","ic-width"],name:"font-size-adjust"},{inherited:!0,keywords:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"],name:"font-stretch"},{inherited:!0,keywords:["normal","italic","oblique"],name:"font-style"},{inherited:!0,longhands:["font-synthesis-weight","font-synthesis-style","font-synthesis-small-caps"],name:"font-synthesis"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-small-caps"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-style"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-weight"},{inherited:!0,longhands:["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position"],name:"font-variant"},{inherited:!0,keywords:["normal"],name:"font-variant-alternates"},{inherited:!0,keywords:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"],name:"font-variant-caps"},{inherited:!0,keywords:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"],name:"font-variant-east-asian"},{inherited:!0,keywords:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"],name:"font-variant-ligatures"},{inherited:!0,keywords:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"],name:"font-variant-numeric"},{inherited:!0,keywords:["normal","sub","super"],name:"font-variant-position"},{inherited:!0,keywords:["normal"],name:"font-variation-settings"},{inherited:!0,keywords:["normal","bold","bolder","lighter"],name:"font-weight"},{inherited:!0,keywords:["auto","none","preserve-parent-color"],name:"forced-color-adjust"},{longhands:["row-gap","column-gap"],name:"gap"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-flow","grid-auto-rows","grid-auto-columns"],name:"grid"},{longhands:["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],name:"grid-area"},{keywords:["auto","min-content","max-content"],name:"grid-auto-columns"},{keywords:["row","column"],name:"grid-auto-flow"},{keywords:["auto","min-content","max-content"],name:"grid-auto-rows"},{longhands:["grid-column-start","grid-column-end"],name:"grid-column"},{keywords:["auto"],name:"grid-column-end"},{longhands:["column-gap"],name:"grid-column-gap"},{keywords:["auto"],name:"grid-column-start"},{longhands:["row-gap","column-gap"],name:"grid-gap"},{longhands:["grid-row-start","grid-row-end"],name:"grid-row"},{keywords:["auto"],name:"grid-row-end"},{longhands:["row-gap"],name:"grid-row-gap"},{keywords:["auto"],name:"grid-row-start"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas"],name:"grid-template"},{keywords:["none"],name:"grid-template-areas"},{keywords:["none"],name:"grid-template-columns"},{keywords:["none"],name:"grid-template-rows"},{keywords:["auto","fit-content","min-content","max-content"],name:"height"},{inherited:!0,name:"hyphenate-character"},{inherited:!0,keywords:["auto"],name:"hyphenate-limit-chars"},{inherited:!0,keywords:["none","manual","auto"],name:"hyphens"},{inherited:!0,name:"image-orientation"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"],name:"image-rendering"},{name:"inherits"},{inherited:!1,keywords:["drop","normal","raise"],name:"initial-letter"},{name:"initial-value"},{keywords:["auto"],name:"inline-size"},{longhands:["top","right","bottom","left"],name:"inset"},{longhands:["inset-block-start","inset-block-end"],name:"inset-block"},{name:"inset-block-end"},{name:"inset-block-start"},{longhands:["inset-inline-start","inset-inline-end"],name:"inset-inline"},{name:"inset-inline-end"},{name:"inset-inline-start"},{keywords:["auto","isolate"],name:"isolation"},{name:"justify-content"},{name:"justify-items"},{name:"justify-self"},{keywords:["auto"],name:"left"},{inherited:!0,keywords:["normal"],name:"letter-spacing"},{keywords:["currentcolor"],name:"lighting-color"},{inherited:!0,keywords:["auto","loose","normal","strict","anywhere"],name:"line-break"},{name:"line-gap-override"},{inherited:!0,keywords:["normal"],name:"line-height"},{inherited:!0,longhands:["list-style-position","list-style-image","list-style-type"],name:"list-style"},{inherited:!0,keywords:["none"],name:"list-style-image"},{inherited:!0,keywords:["outside","inside"],name:"list-style-position"},{inherited:!0,keywords:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"],name:"list-style-type"},{longhands:["margin-top","margin-right","margin-bottom","margin-left"],name:"margin"},{longhands:["margin-block-start","margin-block-end"],name:"margin-block"},{keywords:["auto"],name:"margin-block-end"},{keywords:["auto"],name:"margin-block-start"},{keywords:["auto"],name:"margin-bottom"},{longhands:["margin-inline-start","margin-inline-end"],name:"margin-inline"},{keywords:["auto"],name:"margin-inline-end"},{keywords:["auto"],name:"margin-inline-start"},{keywords:["auto"],name:"margin-left"},{keywords:["auto"],name:"margin-right"},{keywords:["auto"],name:"margin-top"},{inherited:!0,longhands:["marker-start","marker-mid","marker-end"],name:"marker"},{inherited:!0,keywords:["none"],name:"marker-end"},{inherited:!0,keywords:["none"],name:"marker-mid"},{inherited:!0,keywords:["none"],name:"marker-start"},{name:"mask"},{keywords:["luminance","alpha"],name:"mask-type"},{inherited:!0,name:"math-depth"},{inherited:!0,keywords:["normal","compact"],name:"math-shift"},{inherited:!0,keywords:["normal","compact"],name:"math-style"},{keywords:["none"],name:"max-block-size"},{keywords:["none"],name:"max-height"},{keywords:["none"],name:"max-inline-size"},{keywords:["none"],name:"max-width"},{name:"min-block-size"},{name:"min-height"},{name:"min-inline-size"},{name:"min-width"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],name:"mix-blend-mode"},{name:"negative"},{keywords:["fill","contain","cover","none","scale-down"],name:"object-fit"},{name:"object-position"},{keywords:["none"],name:"object-view-box"},{longhands:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],name:"offset"},{keywords:["auto"],name:"offset-anchor"},{name:"offset-distance"},{keywords:["none"],name:"offset-path"},{keywords:["auto","normal"],name:"offset-position"},{keywords:["auto","reverse"],name:"offset-rotate"},{name:"opacity"},{name:"order"},{keywords:["normal","none"],name:"origin-trial-test-property"},{inherited:!0,name:"orphans"},{longhands:["outline-color","outline-style","outline-width"],name:"outline"},{keywords:["currentcolor"],name:"outline-color"},{name:"outline-offset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"outline-style"},{keywords:["thin","medium","thick"],name:"outline-width"},{longhands:["overflow-x","overflow-y"],name:"overflow"},{inherited:!1,keywords:["visible","none","auto"],name:"overflow-anchor"},{name:"overflow-block"},{keywords:["border-box","content-box","padding-box"],name:"overflow-clip-margin"},{name:"overflow-inline"},{inherited:!0,keywords:["normal","break-word","anywhere"],name:"overflow-wrap"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-x"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-y"},{keywords:["none","auto"],name:"overlay"},{name:"override-colors"},{longhands:["overscroll-behavior-x","overscroll-behavior-y"],name:"overscroll-behavior"},{name:"overscroll-behavior-block"},{name:"overscroll-behavior-inline"},{keywords:["auto","contain","none"],name:"overscroll-behavior-x"},{keywords:["auto","contain","none"],name:"overscroll-behavior-y"},{name:"pad"},{longhands:["padding-top","padding-right","padding-bottom","padding-left"],name:"padding"},{longhands:["padding-block-start","padding-block-end"],name:"padding-block"},{name:"padding-block-end"},{name:"padding-block-start"},{name:"padding-bottom"},{longhands:["padding-inline-start","padding-inline-end"],name:"padding-inline"},{name:"padding-inline-end"},{name:"padding-inline-start"},{name:"padding-left"},{name:"padding-right"},{name:"padding-top"},{keywords:["auto"],name:"page"},{longhands:["break-after"],name:"page-break-after"},{longhands:["break-before"],name:"page-break-before"},{longhands:["break-inside"],name:"page-break-inside"},{name:"page-orientation"},{inherited:!0,keywords:["normal","fill","stroke","markers"],name:"paint-order"},{keywords:["none"],name:"perspective"},{name:"perspective-origin"},{longhands:["align-content","justify-content"],name:"place-content"},{longhands:["align-items","justify-items"],name:"place-items"},{longhands:["align-self","justify-self"],name:"place-self"},{inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],name:"pointer-events"},{name:"popover-hide-delay"},{name:"popover-show-delay"},{keywords:["static","relative","absolute","fixed","sticky"],name:"position"},{keywords:["none"],name:"position-fallback"},{name:"prefix"},{inherited:!0,keywords:["auto","none"],name:"quotes"},{name:"r"},{name:"range"},{keywords:["none","both","horizontal","vertical","block","inline"],name:"resize"},{keywords:["auto"],name:"right"},{name:"rotate"},{keywords:["normal"],name:"row-gap"},{inherited:!0,name:"ruby-position"},{keywords:["auto"],name:"rx"},{keywords:["auto"],name:"ry"},{name:"scale"},{keywords:["auto","smooth"],name:"scroll-behavior"},{name:"scroll-customization"},{longhands:["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],name:"scroll-margin"},{longhands:["scroll-margin-block-start","scroll-margin-block-end"],name:"scroll-margin-block"},{name:"scroll-margin-block-end"},{name:"scroll-margin-block-start"},{name:"scroll-margin-bottom"},{longhands:["scroll-margin-inline-start","scroll-margin-inline-end"],name:"scroll-margin-inline"},{name:"scroll-margin-inline-end"},{name:"scroll-margin-inline-start"},{name:"scroll-margin-left"},{name:"scroll-margin-right"},{name:"scroll-margin-top"},{longhands:["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],name:"scroll-padding"},{longhands:["scroll-padding-block-start","scroll-padding-block-end"],name:"scroll-padding-block"},{keywords:["auto"],name:"scroll-padding-block-end"},{keywords:["auto"],name:"scroll-padding-block-start"},{keywords:["auto"],name:"scroll-padding-bottom"},{longhands:["scroll-padding-inline-start","scroll-padding-inline-end"],name:"scroll-padding-inline"},{keywords:["auto"],name:"scroll-padding-inline-end"},{keywords:["auto"],name:"scroll-padding-inline-start"},{keywords:["auto"],name:"scroll-padding-left"},{keywords:["auto"],name:"scroll-padding-right"},{keywords:["auto"],name:"scroll-padding-top"},{keywords:["none","start","end","center"],name:"scroll-snap-align"},{keywords:["normal","always"],name:"scroll-snap-stop"},{keywords:["none","x","y","block","inline","both","mandatory","proximity"],name:"scroll-snap-type"},{longhands:["scroll-start-block","scroll-start-inline"],name:"scroll-start"},{keywords:["auto","start","end","center","top","bottom","left","right"],name:"scroll-start-block"},{keywords:["auto","start","end","center","top","bottom","left","right"],name:"scroll-start-inline"},{longhands:["scroll-start-target-block","scroll-start-target-inline"],name:"scroll-start-target"},{keywords:["none","auto"],name:"scroll-start-target-block"},{keywords:["none","auto"],name:"scroll-start-target-inline"},{keywords:["none","auto"],name:"scroll-start-target-x"},{keywords:["none","auto"],name:"scroll-start-target-y"},{name:"scroll-start-x"},{name:"scroll-start-y"},{longhands:["scroll-timeline-name","scroll-timeline-axis","scroll-timeline-attachment"],name:"scroll-timeline"},{name:"scroll-timeline-attachment"},{name:"scroll-timeline-axis"},{name:"scroll-timeline-name"},{inherited:!0,keywords:["auto"],name:"scrollbar-color"},{inherited:!1,keywords:["auto","stable","both-edges"],name:"scrollbar-gutter"},{inherited:!1,keywords:["auto","thin","none"],name:"scrollbar-width"},{name:"shape-image-threshold"},{keywords:["none"],name:"shape-margin"},{keywords:["none"],name:"shape-outside"},{inherited:!0,keywords:["auto","optimizespeed","crispedges","geometricprecision"],name:"shape-rendering"},{name:"size"},{name:"size-adjust"},{inherited:!0,keywords:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"],name:"speak"},{name:"speak-as"},{name:"src"},{keywords:["currentcolor"],name:"stop-color"},{name:"stop-opacity"},{inherited:!0,name:"stroke"},{inherited:!0,keywords:["none"],name:"stroke-dasharray"},{inherited:!0,name:"stroke-dashoffset"},{inherited:!0,keywords:["butt","round","square"],name:"stroke-linecap"},{inherited:!0,keywords:["miter","bevel","round"],name:"stroke-linejoin"},{inherited:!0,name:"stroke-miterlimit"},{inherited:!0,name:"stroke-opacity"},{inherited:!0,name:"stroke-width"},{name:"suffix"},{name:"symbols"},{name:"syntax"},{name:"system"},{inherited:!0,name:"tab-size"},{keywords:["auto","fixed"],name:"table-layout"},{inherited:!0,keywords:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"],name:"text-align"},{inherited:!0,keywords:["auto","start","end","left","right","center","justify"],name:"text-align-last"},{inherited:!0,keywords:["start","middle","end"],name:"text-anchor"},{keywords:["none","start","end","both"],name:"text-box-trim"},{inherited:!0,keywords:["none","all"],name:"text-combine-upright"},{longhands:["text-decoration-line","text-decoration-thickness","text-decoration-style","text-decoration-color"],name:"text-decoration"},{keywords:["currentcolor"],name:"text-decoration-color"},{keywords:["none","underline","overline","line-through","blink","spelling-error","grammar-error"],name:"text-decoration-line"},{inherited:!0,keywords:["none","auto"],name:"text-decoration-skip-ink"},{keywords:["solid","double","dotted","dashed","wavy"],name:"text-decoration-style"},{inherited:!0,keywords:["auto","from-font"],name:"text-decoration-thickness"},{inherited:!0,longhands:["text-emphasis-style","text-emphasis-color"],name:"text-emphasis"},{inherited:!0,keywords:["currentcolor"],name:"text-emphasis-color"},{inherited:!0,name:"text-emphasis-position"},{inherited:!0,name:"text-emphasis-style"},{inherited:!0,name:"text-indent"},{inherited:!0,keywords:["sideways","mixed","upright"],name:"text-orientation"},{keywords:["clip","ellipsis"],name:"text-overflow"},{inherited:!0,keywords:["auto","optimizespeed","optimizelegibility","geometricprecision"],name:"text-rendering"},{inherited:!0,keywords:["none"],name:"text-shadow"},{inherited:!0,keywords:["none","auto"],name:"text-size-adjust"},{inherited:!0,keywords:["capitalize","uppercase","lowercase","none","math-auto"],name:"text-transform"},{inherited:!0,keywords:["auto"],name:"text-underline-offset"},{inherited:!0,keywords:["auto","from-font","under","left","right"],name:"text-underline-position"},{inherited:!0,keywords:["wrap","nowrap","balance","pretty"],name:"text-wrap"},{name:"timeline-scope"},{longhands:["toggle-root","toggle-trigger"],name:"toggle"},{keywords:["none"],name:"toggle-group"},{keywords:["none"],name:"toggle-root"},{keywords:["none"],name:"toggle-trigger"},{keywords:["normal"],name:"toggle-visibility"},{keywords:["auto"],name:"top"},{keywords:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"],name:"touch-action"},{keywords:["none"],name:"transform"},{keywords:["fill-box","view-box"],name:"transform-box"},{name:"transform-origin"},{keywords:["flat","preserve-3d"],name:"transform-style"},{longhands:["transition-property","transition-duration","transition-timing-function","transition-delay"],name:"transition"},{name:"transition-delay"},{name:"transition-duration"},{keywords:["none"],name:"transition-property"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"transition-timing-function"},{name:"translate"},{keywords:["normal","embed","bidi-override","isolate","plaintext","isolate-override"],name:"unicode-bidi"},{name:"unicode-range"},{inherited:!0,keywords:["auto","none","text","all","contain"],name:"user-select"},{keywords:["none","non-scaling-stroke"],name:"vector-effect"},{keywords:["baseline","sub","super","text-top","text-bottom","middle"],name:"vertical-align"},{longhands:["view-timeline-name","view-timeline-axis","view-timeline-attachment"],name:"view-timeline"},{name:"view-timeline-attachment"},{name:"view-timeline-axis"},{name:"view-timeline-inset"},{name:"view-timeline-name"},{keywords:["none"],name:"view-transition-name"},{inherited:!0,keywords:["visible","hidden","collapse"],name:"visibility"},{inherited:!0,keywords:["normal","pre","pre-wrap","pre-line","nowrap","break-spaces"],name:"white-space"},{inherited:!0,keywords:["collapse","preserve","preserve-breaks","break-spaces"],name:"white-space-collapse"},{inherited:!0,name:"widows"},{keywords:["auto","fit-content","min-content","max-content"],name:"width"},{keywords:["auto"],name:"will-change"},{inherited:!0,keywords:["normal"],name:"word-boundary-detection"},{inherited:!0,keywords:["normal","break-all","keep-all","break-word"],name:"word-break"},{inherited:!0,keywords:["normal"],name:"word-spacing"},{inherited:!0,keywords:["horizontal-tb","vertical-rl","vertical-lr"],name:"writing-mode"},{name:"x"},{name:"y"},{keywords:["auto"],name:"z-index"},{name:"zoom"}],g={"-webkit-box-align":{values:["stretch","start","center","end","baseline"]},"-webkit-box-decoration-break":{values:["slice","clone"]},"-webkit-box-direction":{values:["normal","reverse"]},"-webkit-box-orient":{values:["horizontal","vertical"]},"-webkit-box-pack":{values:["start","center","end","justify"]},"-webkit-line-break":{values:["auto","loose","normal","strict","after-white-space","anywhere"]},"-webkit-print-color-adjust":{values:["economy","exact"]},"-webkit-rtl-ordering":{values:["logical","visual"]},"-webkit-ruby-position":{values:["before","after"]},"-webkit-text-security":{values:["none","disc","circle","square"]},"-webkit-user-drag":{values:["auto","none","element"]},"-webkit-user-modify":{values:["read-only","read-write","read-write-plaintext-only"]},"accent-color":{values:["auto","currentcolor"]},"alignment-baseline":{values:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"]},"anchor-default":{values:["none"]},"anchor-name":{values:["none"]},"anchor-scroll":{values:["none"]},"animation-composition":{values:["replace","add","accumulate"]},"animation-direction":{values:["normal","reverse","alternate","alternate-reverse"]},"animation-fill-mode":{values:["none","forwards","backwards","both"]},"animation-iteration-count":{values:["infinite"]},"animation-name":{values:["none"]},"animation-play-state":{values:["running","paused"]},"animation-timeline":{values:["none","auto"]},"animation-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"app-region":{values:["none","drag","no-drag"]},"aspect-ratio":{values:["auto"]},"backdrop-filter":{values:["none"]},"backface-visibility":{values:["visible","hidden"]},"background-attachment":{values:["scroll","fixed","local"]},"background-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"background-clip":{values:["border-box","padding-box","content-box"]},"background-color":{values:["currentcolor"]},"background-image":{values:["auto","none"]},"background-origin":{values:["border-box","padding-box","content-box"]},"background-size":{values:["auto","cover","contain"]},"baseline-shift":{values:["baseline","sub","super"]},"baseline-source":{values:["auto","first","last"]},"block-size":{values:["auto"]},"border-bottom-color":{values:["currentcolor"]},"border-bottom-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-bottom-width":{values:["thin","medium","thick"]},"border-collapse":{values:["separate","collapse"]},"border-image-repeat":{values:["stretch","repeat","round","space"]},"border-image-source":{values:["none"]},"border-image-width":{values:["auto"]},"border-left-color":{values:["currentcolor"]},"border-left-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-left-width":{values:["thin","medium","thick"]},"border-right-color":{values:["currentcolor"]},"border-right-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-right-width":{values:["thin","medium","thick"]},"border-style":{values:["none"]},"border-top-color":{values:["currentcolor"]},"border-top-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-top-width":{values:["thin","medium","thick"]},bottom:{values:["auto"]},"box-shadow":{values:["none"]},"box-sizing":{values:["content-box","border-box"]},"break-after":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-before":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-inside":{values:["auto","avoid","avoid-column","avoid-page"]},"buffered-rendering":{values:["auto","dynamic","static"]},"caption-side":{values:["top","bottom"]},"caret-color":{values:["auto","currentcolor"]},clear:{values:["none","left","right","both","inline-start","inline-end"]},clip:{values:["auto"]},"clip-path":{values:["none"]},"clip-rule":{values:["nonzero","evenodd"]},color:{values:["currentcolor"]},"color-interpolation":{values:["auto","srgb","linearrgb"]},"color-interpolation-filters":{values:["auto","srgb","linearrgb"]},"color-rendering":{values:["auto","optimizespeed","optimizequality"]},"column-count":{values:["auto"]},"column-fill":{values:["balance","auto"]},"column-gap":{values:["normal"]},"column-rule-color":{values:["currentcolor"]},"column-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"column-rule-width":{values:["thin","medium","thick"]},"column-span":{values:["none","all"]},"column-width":{values:["auto"]},contain:{values:["none","strict","content","size","layout","style","paint","inline-size","block-size"]},"contain-intrinsic-height":{values:["auto","none"]},"contain-intrinsic-width":{values:["auto","none"]},"container-name":{values:["none"]},"container-type":{values:["normal","inline-size","size","sticky"]},"content-visibility":{values:["visible","auto","hidden"]},"counter-increment":{values:["none"]},"counter-reset":{values:["none"]},"counter-set":{values:["none"]},cursor:{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]},d:{values:["none"]},direction:{values:["ltr","rtl"]},display:{values:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math"]},"dominant-baseline":{values:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"]},"empty-cells":{values:["show","hide"]},"fill-rule":{values:["nonzero","evenodd"]},filter:{values:["none"]},"flex-basis":{values:["auto","fit-content","min-content","max-content","content"]},"flex-direction":{values:["row","row-reverse","column","column-reverse"]},"flex-wrap":{values:["nowrap","wrap","wrap-reverse"]},float:{values:["none","left","right","inline-start","inline-end"]},"flood-color":{values:["currentcolor"]},"font-feature-settings":{values:["normal"]},"font-kerning":{values:["auto","normal","none"]},"font-optical-sizing":{values:["auto","none"]},"font-palette":{values:["normal","light","dark"]},"font-size":{values:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"]},"font-size-adjust":{values:["none","ex-height","cap-height","ch-width","ic-width"]},"font-stretch":{values:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]},"font-style":{values:["normal","italic","oblique"]},"font-synthesis-small-caps":{values:["auto","none"]},"font-synthesis-style":{values:["auto","none"]},"font-synthesis-weight":{values:["auto","none"]},"font-variant-alternates":{values:["normal"]},"font-variant-caps":{values:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]},"font-variant-east-asian":{values:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]},"font-variant-ligatures":{values:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"]},"font-variant-numeric":{values:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"]},"font-variant-position":{values:["normal","sub","super"]},"font-variation-settings":{values:["normal"]},"font-weight":{values:["normal","bold","bolder","lighter"]},"forced-color-adjust":{values:["auto","none","preserve-parent-color"]},"grid-auto-columns":{values:["auto","min-content","max-content"]},"grid-auto-flow":{values:["row","column"]},"grid-auto-rows":{values:["auto","min-content","max-content"]},"grid-column-end":{values:["auto"]},"grid-column-start":{values:["auto"]},"grid-row-end":{values:["auto"]},"grid-row-start":{values:["auto"]},"grid-template-areas":{values:["none"]},"grid-template-columns":{values:["none"]},"grid-template-rows":{values:["none"]},height:{values:["auto","fit-content","min-content","max-content"]},"hyphenate-limit-chars":{values:["auto"]},hyphens:{values:["none","manual","auto"]},"image-rendering":{values:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"]},"initial-letter":{values:["drop","normal","raise"]},"inline-size":{values:["auto"]},isolation:{values:["auto","isolate"]},left:{values:["auto"]},"letter-spacing":{values:["normal"]},"lighting-color":{values:["currentcolor"]},"line-break":{values:["auto","loose","normal","strict","anywhere"]},"line-height":{values:["normal"]},"list-style-image":{values:["none"]},"list-style-position":{values:["outside","inside"]},"list-style-type":{values:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"]},"margin-block-end":{values:["auto"]},"margin-block-start":{values:["auto"]},"margin-bottom":{values:["auto"]},"margin-inline-end":{values:["auto"]},"margin-inline-start":{values:["auto"]},"margin-left":{values:["auto"]},"margin-right":{values:["auto"]},"margin-top":{values:["auto"]},"marker-end":{values:["none"]},"marker-mid":{values:["none"]},"marker-start":{values:["none"]},"mask-type":{values:["luminance","alpha"]},"math-shift":{values:["normal","compact"]},"math-style":{values:["normal","compact"]},"max-block-size":{values:["none"]},"max-height":{values:["none"]},"max-inline-size":{values:["none"]},"max-width":{values:["none"]},"mix-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},"object-fit":{values:["fill","contain","cover","none","scale-down"]},"object-view-box":{values:["none"]},"offset-anchor":{values:["auto"]},"offset-path":{values:["none"]},"offset-position":{values:["auto","normal"]},"offset-rotate":{values:["auto","reverse"]},"origin-trial-test-property":{values:["normal","none"]},"outline-color":{values:["currentcolor"]},"outline-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"outline-width":{values:["thin","medium","thick"]},"overflow-anchor":{values:["visible","none","auto"]},"overflow-clip-margin":{values:["border-box","content-box","padding-box"]},"overflow-wrap":{values:["normal","break-word","anywhere"]},"overflow-x":{values:["visible","hidden","scroll","auto","overlay","clip"]},"overflow-y":{values:["visible","hidden","scroll","auto","overlay","clip"]},overlay:{values:["none","auto"]},"overscroll-behavior-x":{values:["auto","contain","none"]},"overscroll-behavior-y":{values:["auto","contain","none"]},page:{values:["auto"]},"paint-order":{values:["normal","fill","stroke","markers"]},perspective:{values:["none"]},"pointer-events":{values:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"]},position:{values:["static","relative","absolute","fixed","sticky"]},"position-fallback":{values:["none"]},quotes:{values:["auto","none"]},resize:{values:["none","both","horizontal","vertical","block","inline"]},right:{values:["auto"]},"row-gap":{values:["normal"]},rx:{values:["auto"]},ry:{values:["auto"]},"scroll-behavior":{values:["auto","smooth"]},"scroll-padding-block-end":{values:["auto"]},"scroll-padding-block-start":{values:["auto"]},"scroll-padding-bottom":{values:["auto"]},"scroll-padding-inline-end":{values:["auto"]},"scroll-padding-inline-start":{values:["auto"]},"scroll-padding-left":{values:["auto"]},"scroll-padding-right":{values:["auto"]},"scroll-padding-top":{values:["auto"]},"scroll-snap-align":{values:["none","start","end","center"]},"scroll-snap-stop":{values:["normal","always"]},"scroll-snap-type":{values:["none","x","y","block","inline","both","mandatory","proximity"]},"scroll-start-block":{values:["auto","start","end","center","top","bottom","left","right"]},"scroll-start-inline":{values:["auto","start","end","center","top","bottom","left","right"]},"scroll-start-target-block":{values:["none","auto"]},"scroll-start-target-inline":{values:["none","auto"]},"scroll-start-target-x":{values:["none","auto"]},"scroll-start-target-y":{values:["none","auto"]},"scrollbar-color":{values:["auto"]},"scrollbar-gutter":{values:["auto","stable","both-edges"]},"scrollbar-width":{values:["auto","thin","none"]},"shape-margin":{values:["none"]},"shape-outside":{values:["none"]},"shape-rendering":{values:["auto","optimizespeed","crispedges","geometricprecision"]},speak:{values:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"]},"stop-color":{values:["currentcolor"]},"stroke-dasharray":{values:["none"]},"stroke-linecap":{values:["butt","round","square"]},"stroke-linejoin":{values:["miter","bevel","round"]},"table-layout":{values:["auto","fixed"]},"text-align":{values:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"]},"text-align-last":{values:["auto","start","end","left","right","center","justify"]},"text-anchor":{values:["start","middle","end"]},"text-box-trim":{values:["none","start","end","both"]},"text-combine-upright":{values:["none","all"]},"text-decoration-color":{values:["currentcolor"]},"text-decoration-line":{values:["none","underline","overline","line-through","blink","spelling-error","grammar-error"]},"text-decoration-skip-ink":{values:["none","auto"]},"text-decoration-style":{values:["solid","double","dotted","dashed","wavy"]},"text-decoration-thickness":{values:["auto","from-font"]},"text-emphasis-color":{values:["currentcolor"]},"text-orientation":{values:["sideways","mixed","upright"]},"text-overflow":{values:["clip","ellipsis"]},"text-rendering":{values:["auto","optimizespeed","optimizelegibility","geometricprecision"]},"text-shadow":{values:["none"]},"text-size-adjust":{values:["none","auto"]},"text-transform":{values:["capitalize","uppercase","lowercase","none","math-auto"]},"text-underline-offset":{values:["auto"]},"text-underline-position":{values:["auto","from-font","under","left","right"]},"text-wrap":{values:["wrap","nowrap","balance","pretty"]},"toggle-group":{values:["none"]},"toggle-root":{values:["none"]},"toggle-trigger":{values:["none"]},"toggle-visibility":{values:["normal"]},top:{values:["auto"]},"touch-action":{values:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"]},transform:{values:["none"]},"transform-box":{values:["fill-box","view-box"]},"transform-style":{values:["flat","preserve-3d"]},"transition-property":{values:["none"]},"transition-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"unicode-bidi":{values:["normal","embed","bidi-override","isolate","plaintext","isolate-override"]},"user-select":{values:["auto","none","text","all","contain"]},"vector-effect":{values:["none","non-scaling-stroke"]},"vertical-align":{values:["baseline","sub","super","text-top","text-bottom","middle"]},"view-transition-name":{values:["none"]},visibility:{values:["visible","hidden","collapse"]},"white-space":{values:["normal","pre","pre-wrap","pre-line","nowrap","break-spaces"]},"white-space-collapse":{values:["collapse","preserve","preserve-breaks","break-spaces"]},width:{values:["auto","fit-content","min-content","max-content"]},"will-change":{values:["auto"]},"word-boundary-detection":{values:["normal"]},"word-break":{values:["normal","break-all","keep-all","break-word"]},"word-spacing":{values:["normal"]},"writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr"]},"z-index":{values:["auto"]}},p=new Map([["-epub-caption-side","caption-side"],["-epub-text-combine","-webkit-text-combine"],["-epub-text-emphasis","text-emphasis"],["-epub-text-emphasis-color","text-emphasis-color"],["-epub-text-emphasis-style","text-emphasis-style"],["-epub-text-orientation","-webkit-text-orientation"],["-epub-text-transform","text-transform"],["-epub-word-break","word-break"],["-epub-writing-mode","-webkit-writing-mode"],["-webkit-align-content","align-content"],["-webkit-align-items","align-items"],["-webkit-align-self","align-self"],["-webkit-alternative-animation-delay","-alternative-animation-delay"],["-webkit-alternative-animation-with-delay-start-end","-alternative-animation-with-delay-start-end"],["-webkit-alternative-animation-with-timeline","-alternative-animation-with-timeline"],["-webkit-animation","animation"],["-webkit-animation-delay","animation-delay"],["-webkit-animation-direction","animation-direction"],["-webkit-animation-duration","animation-duration"],["-webkit-animation-fill-mode","animation-fill-mode"],["-webkit-animation-iteration-count","animation-iteration-count"],["-webkit-animation-name","animation-name"],["-webkit-animation-play-state","animation-play-state"],["-webkit-animation-timing-function","animation-timing-function"],["-webkit-app-region","app-region"],["-webkit-appearance","appearance"],["-webkit-backface-visibility","backface-visibility"],["-webkit-background-clip","background-clip"],["-webkit-background-origin","background-origin"],["-webkit-background-size","background-size"],["-webkit-border-after","border-block-end"],["-webkit-border-after-color","border-block-end-color"],["-webkit-border-after-style","border-block-end-style"],["-webkit-border-after-width","border-block-end-width"],["-webkit-border-before","border-block-start"],["-webkit-border-before-color","border-block-start-color"],["-webkit-border-before-style","border-block-start-style"],["-webkit-border-before-width","border-block-start-width"],["-webkit-border-bottom-left-radius","border-bottom-left-radius"],["-webkit-border-bottom-right-radius","border-bottom-right-radius"],["-webkit-border-end","border-inline-end"],["-webkit-border-end-color","border-inline-end-color"],["-webkit-border-end-style","border-inline-end-style"],["-webkit-border-end-width","border-inline-end-width"],["-webkit-border-radius","border-radius"],["-webkit-border-start","border-inline-start"],["-webkit-border-start-color","border-inline-start-color"],["-webkit-border-start-style","border-inline-start-style"],["-webkit-border-start-width","border-inline-start-width"],["-webkit-border-top-left-radius","border-top-left-radius"],["-webkit-border-top-right-radius","border-top-right-radius"],["-webkit-box-shadow","box-shadow"],["-webkit-box-sizing","box-sizing"],["-webkit-clip-path","clip-path"],["-webkit-column-count","column-count"],["-webkit-column-gap","column-gap"],["-webkit-column-rule","column-rule"],["-webkit-column-rule-color","column-rule-color"],["-webkit-column-rule-style","column-rule-style"],["-webkit-column-rule-width","column-rule-width"],["-webkit-column-span","column-span"],["-webkit-column-width","column-width"],["-webkit-columns","columns"],["-webkit-filter","filter"],["-webkit-flex","flex"],["-webkit-flex-basis","flex-basis"],["-webkit-flex-direction","flex-direction"],["-webkit-flex-flow","flex-flow"],["-webkit-flex-grow","flex-grow"],["-webkit-flex-shrink","flex-shrink"],["-webkit-flex-wrap","flex-wrap"],["-webkit-font-feature-settings","font-feature-settings"],["-webkit-hyphenate-character","hyphenate-character"],["-webkit-justify-content","justify-content"],["-webkit-logical-height","block-size"],["-webkit-logical-width","inline-size"],["-webkit-margin-after","margin-block-end"],["-webkit-margin-before","margin-block-start"],["-webkit-margin-end","margin-inline-end"],["-webkit-margin-start","margin-inline-start"],["-webkit-max-logical-height","max-block-size"],["-webkit-max-logical-width","max-inline-size"],["-webkit-min-logical-height","min-block-size"],["-webkit-min-logical-width","min-inline-size"],["-webkit-opacity","opacity"],["-webkit-order","order"],["-webkit-padding-after","padding-block-end"],["-webkit-padding-before","padding-block-start"],["-webkit-padding-end","padding-inline-end"],["-webkit-padding-start","padding-inline-start"],["-webkit-perspective","perspective"],["-webkit-perspective-origin","perspective-origin"],["-webkit-shape-image-threshold","shape-image-threshold"],["-webkit-shape-margin","shape-margin"],["-webkit-shape-outside","shape-outside"],["-webkit-text-emphasis","text-emphasis"],["-webkit-text-emphasis-color","text-emphasis-color"],["-webkit-text-emphasis-position","text-emphasis-position"],["-webkit-text-emphasis-style","text-emphasis-style"],["-webkit-text-size-adjust","text-size-adjust"],["-webkit-transform","transform"],["-webkit-transform-origin","transform-origin"],["-webkit-transform-style","transform-style"],["-webkit-transition","transition"],["-webkit-transition-delay","transition-delay"],["-webkit-transition-duration","transition-duration"],["-webkit-transition-property","transition-property"],["-webkit-transition-timing-function","transition-timing-function"],["-webkit-user-select","user-select"],["word-wrap","overflow-wrap"]]);class m{#t;#n;#r;#s;#i;#a;#o;#l;#d;#c;constructor(e,n){this.#t=[],this.#n=new Map,this.#r=new Map,this.#s=new Set,this.#i=new Set,this.#a=new Map,this.#o=n;for(let t=0;t<e.length;++t){const n=e[t],r=n.name;if(!CSS.supports(r,"initial"))continue;this.#t.push(r),n.inherited&&this.#s.add(r),n.svg&&this.#i.add(r);const s=e[t].longhands;if(s){this.#n.set(r,s);for(let e=0;e<s.length;++e){const t=s[e];let n=this.#r.get(t);n||(n=[],this.#r.set(t,n)),n.push(r)}}}this.#t.sort(m.sortPrefixesToEnd),this.#l=new Set(this.#t);const r=new Map;for(const[e,t]of Object.entries(g))r.set(e,new Set(t.values));for(const[e,n]of Object.entries(M)){const s=r.get(e);s?t.SetUtilities.addAll(s,n.values):r.set(e,new Set(n.values))}for(const[e,t]of r){for(const n of L)!t.has(n)&&CSS.supports(e,n)&&t.add(n);this.#a.set(e,[...t])}this.#d=[],this.#c=[];for(const e of this.#l){const t=this.specificPropertyValues(e).filter((t=>CSS.supports(e,t))).sort(m.sortPrefixesToEnd).map((t=>`${e}: ${t}`));this.isSVGProperty(e)||this.#d.push(...t),this.#c.push(...t)}}static sortPrefixesToEnd(e,t){const n=e.startsWith("-webkit-"),r=t.startsWith("-webkit-");return n&&!r?1:!n&&r||e<t?-1:e>t?1:0}allProperties(){return this.#t}aliasesFor(){return this.#o}nameValuePresets(e){return e?this.#c:this.#d}isSVGProperty(e){return e=e.toLowerCase(),this.#i.has(e)}getLonghands(e){return this.#n.get(e)||null}getShorthands(e){return this.#r.get(e)||null}isColorAwareProperty(e){return R.has(e.toLowerCase())||this.isCustomProperty(e.toLowerCase())}isFontFamilyProperty(e){return"font-family"===e.toLowerCase()}isAngleAwareProperty(e){const t=e.toLowerCase();return R.has(t)||x.has(t)}isGridAreaDefiningProperty(e){return"grid"===(e=e.toLowerCase())||"grid-template"===e||"grid-template-areas"===e}isLengthProperty(e){return"line-height"!==(e=e.toLowerCase())&&(w.has(e)||e.startsWith("margin")||e.startsWith("padding")||-1!==e.indexOf("width")||-1!==e.indexOf("height"))}isBezierAwareProperty(e){return e=e.toLowerCase(),C.has(e)||this.isCustomProperty(e)}isFontAwareProperty(e){return e=e.toLowerCase(),T.has(e)||this.isCustomProperty(e)}isCustomProperty(e){return e.startsWith("--")}isShadowProperty(e){return"box-shadow"===(e=e.toLowerCase())||"text-shadow"===e||"-webkit-box-shadow"===e}isStringProperty(e){return"content"===(e=e.toLowerCase())}canonicalPropertyName(e){if(this.isCustomProperty(e))return e;e=e.toLowerCase();const t=this.#o.get(e);if(t)return t;if(!e||e.length<9||"-"!==e.charAt(0))return e;const n=e.match(/(?:-webkit-)(.+)/);return n&&this.#l.has(n[1])?n[1]:e}isCSSPropertyName(e){return!!((e=e.toLowerCase()).startsWith("--")&&e.length>2||e.startsWith("-moz-")||e.startsWith("-ms-")||e.startsWith("-o-")||e.startsWith("-webkit-"))||this.#l.has(e)}isPropertyInherited(e){return(e=e.toLowerCase()).startsWith("--")||this.#s.has(this.canonicalPropertyName(e))||this.#s.has(e)}specificPropertyValues(e){const t=e.replace(/^-webkit-/,""),n=this.#a;let r=n.get(e)||n.get(t);if(!r){r=[];for(const t of L)CSS.supports(e,t)&&r.push(t);n.set(e,r)}return r}getPropertyValues(t){const n=["inherit","initial","revert","unset"];if(t=t.toLowerCase(),n.push(...this.specificPropertyValues(t)),this.isColorAwareProperty(t)){n.push("currentColor");for(const t of e.Color.Nicknames.keys())n.push(t)}return n.sort(m.sortPrefixesToEnd)}propertyUsageWeight(e){return P.get(e)||P.get(this.canonicalPropertyName(e))||0}getValuePreset(e,t){const n=S.get(e);let r=n?n.get(t):null;if(!r)return null;let s=r.length,i=r.length;return r&&(s=r.indexOf("|"),i=r.lastIndexOf("|"),i=s===i?i:i-1,r=r.replace(/\|/g,"")),{text:r,startColumn:s,endColumn:i}}isHighlightPseudoType(e){return"highlight"===e||"selection"===e||"target-text"===e||"grammar-error"===e||"spelling-error"===e}}const f=/(var\(\s*--.*?\))/g,b=/((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;let y=null;function v(){if(!y){y=new m(u,p)}return y}const I=new Map([["linear-gradient","linear-gradient(|45deg, black, transparent|)"],["radial-gradient","radial-gradient(|black, transparent|)"],["repeating-linear-gradient","repeating-linear-gradient(|45deg, black, transparent 100px|)"],["repeating-radial-gradient","repeating-radial-gradient(|black, transparent 100px|)"],["url","url(||)"]]),k=new Map([["blur","blur(|1px|)"],["brightness","brightness(|0.5|)"],["contrast","contrast(|0.5|)"],["drop-shadow","drop-shadow(|2px 4px 6px black|)"],["grayscale","grayscale(|1|)"],["hue-rotate","hue-rotate(|45deg|)"],["invert","invert(|1|)"],["opacity","opacity(|0.5|)"],["saturate","saturate(|0.5|)"],["sepia","sepia(|1|)"],["url","url(||)"]]),S=new Map([["filter",k],["backdrop-filter",k],["background",I],["background-image",I],["-webkit-mask-image",I],["transform",new Map([["scale","scale(|1.5|)"],["scaleX","scaleX(|1.5|)"],["scaleY","scaleY(|1.5|)"],["scale3d","scale3d(|1.5, 1.5, 1.5|)"],["rotate","rotate(|45deg|)"],["rotateX","rotateX(|45deg|)"],["rotateY","rotateY(|45deg|)"],["rotateZ","rotateZ(|45deg|)"],["rotate3d","rotate3d(|1, 1, 1, 45deg|)"],["skew","skew(|10deg, 10deg|)"],["skewX","skewX(|10deg|)"],["skewY","skewY(|10deg|)"],["translate","translate(|10px, 10px|)"],["translateX","translateX(|10px|)"],["translateY","translateY(|10px|)"],["translateZ","translateZ(|10px|)"],["translate3d","translate3d(|10px, 10px, 10px|)"],["matrix","matrix(|1, 0, 0, 1, 0, 0|)"],["matrix3d","matrix3d(|1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1|)"],["perspective","perspective(|10px|)"]])]]),w=new Set(["background-position","border-spacing","bottom","font-size","height","left","letter-spacing","max-height","max-width","min-height","min-width","right","text-indent","top","width","word-spacing","grid-row-gap","grid-column-gap","row-gap"]),C=new Set(["animation","animation-timing-function","transition","transition-timing-function","-webkit-animation","-webkit-animation-timing-function","-webkit-transition","-webkit-transition-timing-function"]),T=new Set(["font-size","line-height","font-weight","font-family","letter-spacing"]),R=new Set(["accent-color","background","background-color","background-image","border","border-color","border-image","border-image-source","border-bottom","border-bottom-color","border-left","border-left-color","border-right","border-right-color","border-top","border-top-color","box-shadow","caret-color","color","column-rule","column-rule-color","content","fill","list-style-image","outline","outline-color","stop-color","stroke","text-decoration-color","text-shadow","-webkit-border-after","-webkit-border-after-color","-webkit-border-before","-webkit-border-before-color","-webkit-border-end","-webkit-border-end-color","-webkit-border-start","-webkit-border-start-color","-webkit-box-reflect","-webkit-box-shadow","-webkit-column-rule-color","-webkit-mask","-webkit-mask-box-image","-webkit-mask-box-image-source","-webkit-mask-image","-webkit-tap-highlight-color","-webkit-text-decoration-color","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color"]),x=new Set(["-webkit-border-image","transform","-webkit-transform","rotate","filter","-webkit-filter","backdrop-filter","offset","offset-rotate","font-style"]),M={"background-repeat":{values:["repeat","repeat-x","repeat-y","no-repeat","space","round"]},content:{values:["normal","close-quote","no-close-quote","no-open-quote","open-quote"]},"baseline-shift":{values:["baseline"]},"max-height":{values:["min-content","max-content","-webkit-fill-available","fit-content"]},color:{values:["black"]},"background-color":{values:["white"]},"box-shadow":{values:["inset"]},"text-shadow":{values:["0 0 black"]},"-webkit-writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr"]},"writing-mode":{values:["lr","rl","tb","lr-tb","rl-tb","tb-rl"]},"page-break-inside":{values:["avoid"]},cursor:{values:["-webkit-zoom-in","-webkit-zoom-out","-webkit-grab","-webkit-grabbing"]},"border-width":{values:["medium","thick","thin"]},"border-style":{values:["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},size:{values:["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"]},overflow:{values:["hidden","visible","overlay","scroll"]},"overscroll-behavior":{values:["contain"]},"text-rendering":{values:["optimizeSpeed","optimizeLegibility","geometricPrecision"]},"text-align":{values:["-webkit-auto","-webkit-match-parent"]},"clip-path":{values:["circle","ellipse","inset","polygon","url"]},"color-interpolation":{values:["sRGB","linearRGB"]},"word-wrap":{values:["normal","break-word"]},"font-weight":{values:["100","200","300","400","500","600","700","800","900"]},"-webkit-text-emphasis":{values:["circle","filled","open","dot","double-circle","triangle","sesame"]},"color-rendering":{values:["optimizeSpeed","optimizeQuality"]},"-webkit-text-combine":{values:["horizontal"]},"text-orientation":{values:["sideways-right"]},outline:{values:["inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"]},font:{values:["caption","icon","menu","message-box","small-caption","-webkit-mini-control","-webkit-small-control","-webkit-control","status-bar"]},"dominant-baseline":{values:["text-before-edge","text-after-edge","use-script","no-change","reset-size"]},"-webkit-text-emphasis-position":{values:["over","under"]},"alignment-baseline":{values:["before-edge","after-edge","text-before-edge","text-after-edge","hanging"]},"page-break-before":{values:["left","right","always","avoid"]},"border-image":{values:["repeat","stretch","space","round"]},"text-decoration":{values:["blink","line-through","overline","underline","wavy","double","solid","dashed","dotted"]},"font-family":{values:["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-webkit-body"]},zoom:{values:["normal"]},"max-width":{values:["min-content","max-content","-webkit-fill-available","fit-content"]},"-webkit-font-smoothing":{values:["antialiased","subpixel-antialiased"]},border:{values:["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"]},"font-variant":{values:["small-caps","normal","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]},"vertical-align":{values:["top","bottom","-webkit-baseline-middle"]},"page-break-after":{values:["left","right","always","avoid"]},"-webkit-text-emphasis-style":{values:["circle","filled","open","dot","double-circle","triangle","sesame"]},transform:{values:["scale","scaleX","scaleY","scale3d","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d","perspective"]},"align-content":{values:["normal","baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end"]},"justify-content":{values:["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right"]},"place-content":{values:["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","baseline"]},"align-items":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end"]},"justify-items":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","legacy"]},"place-items":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end"]},"align-self":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end"]},"justify-self":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right"]},"place-self":{values:["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end"]},"perspective-origin":{values:["left","center","right","top","bottom"]},"transform-origin":{values:["left","center","right","top","bottom"]},"transition-timing-function":{values:["cubic-bezier","steps"]},"animation-timing-function":{values:["cubic-bezier","steps"]},"-webkit-backface-visibility":{values:["visible","hidden"]},"-webkit-column-break-after":{values:["always","avoid"]},"-webkit-column-break-before":{values:["always","avoid"]},"-webkit-column-break-inside":{values:["avoid"]},"-webkit-column-span":{values:["all"]},"-webkit-column-gap":{values:["normal"]},filter:{values:["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"]},"backdrop-filter":{values:["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"]},"mix-blend-mode":{values:["unset"]},"background-blend-mode":{values:["unset"]},"grid-template-columns":{values:["min-content","max-content"]},"grid-template-rows":{values:["min-content","max-content"]},"grid-auto-flow":{values:["dense"]},background:{values:["repeat","repeat-x","repeat-y","no-repeat","top","bottom","left","right","center","fixed","local","scroll","space","round","border-box","content-box","padding-box","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"]},"background-image":{values:["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"]},"background-position":{values:["top","bottom","left","right","center"]},"background-position-x":{values:["left","right","center"]},"background-position-y":{values:["top","bottom","center"]},"background-repeat-x":{values:["repeat","no-repeat"]},"background-repeat-y":{values:["repeat","no-repeat"]},"border-bottom":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"border-left":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"border-right":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"border-top":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"buffered-rendering":{values:["static","dynamic"]},"color-interpolation-filters":{values:["srgb","linearrgb"]},"column-rule":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"flex-flow":{values:["nowrap","row","row-reverse","column","column-reverse","wrap","wrap-reverse"]},height:{values:["-webkit-fill-available"]},"inline-size":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"list-style":{values:["outside","inside","disc","circle","square","decimal","decimal-leading-zero","arabic-indic","bengali","cambodian","khmer","devanagari","gujarati","gurmukhi","kannada","lao","malayalam","mongolian","myanmar","oriya","persian","urdu","telugu","tibetan","thai","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","cjk-earthly-branch","cjk-heavenly-stem","ethiopic-halehame","ethiopic-halehame-am","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","hangul","hangul-consonant","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","hebrew","armenian","lower-armenian","upper-armenian","georgian","cjk-ideographic","simp-chinese-formal","simp-chinese-informal","trad-chinese-formal","trad-chinese-informal","hiragana","katakana","hiragana-iroha","katakana-iroha"]},"max-block-size":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"max-inline-size":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"min-block-size":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"min-height":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"min-inline-size":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"min-width":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"object-position":{values:["top","bottom","left","right","center"]},"shape-outside":{values:["border-box","content-box","padding-box","margin-box"]},"-webkit-appearance":{values:["checkbox","radio","push-button","square-button","button","inner-spin-button","listbox","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","menulist","menulist-button","meter","progress-bar","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","searchfield","searchfield-cancel-button","textfield","textarea"]},"-webkit-border-after":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"-webkit-border-after-style":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"-webkit-border-after-width":{values:["medium","thick","thin"]},"-webkit-border-before":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"-webkit-border-before-style":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"-webkit-border-before-width":{values:["medium","thick","thin"]},"-webkit-border-end":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"-webkit-border-end-style":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"-webkit-border-end-width":{values:["medium","thick","thin"]},"-webkit-border-start":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"]},"-webkit-border-start-style":{values:["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"-webkit-border-start-width":{values:["medium","thick","thin"]},"-webkit-logical-height":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-logical-width":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-margin-collapse":{values:["collapse","separate","discard"]},"-webkit-mask-box-image":{values:["repeat","stretch","space","round"]},"-webkit-mask-box-image-repeat":{values:["repeat","stretch","space","round"]},"-webkit-mask-clip":{values:["text","border","border-box","content","content-box","padding","padding-box"]},"-webkit-mask-composite":{values:["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-lighter"]},"-webkit-mask-image":{values:["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"]},"-webkit-mask-origin":{values:["border","border-box","content","content-box","padding","padding-box"]},"-webkit-mask-position":{values:["top","bottom","left","right","center"]},"-webkit-mask-position-x":{values:["left","right","center"]},"-webkit-mask-position-y":{values:["top","bottom","center"]},"-webkit-mask-repeat":{values:["repeat","repeat-x","repeat-y","no-repeat","space","round"]},"-webkit-mask-size":{values:["contain","cover"]},"-webkit-max-logical-height":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-max-logical-width":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-min-logical-height":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-min-logical-width":{values:["-webkit-fill-available","min-content","max-content","fit-content"]},"-webkit-perspective-origin-x":{values:["left","right","center"]},"-webkit-perspective-origin-y":{values:["top","bottom","center"]},"-webkit-text-decorations-in-effect":{values:["blink","line-through","overline","underline"]},"-webkit-text-stroke":{values:["medium","thick","thin"]},"-webkit-text-stroke-width":{values:["medium","thick","thin"]},"-webkit-transform-origin-x":{values:["left","right","center"]},"-webkit-transform-origin-y":{values:["top","bottom","center"]},width:{values:["-webkit-fill-available"]}},P=new Map([["align-content",57],["align-items",129],["align-self",55],["animation",175],["animation-delay",114],["animation-direction",113],["animation-duration",137],["animation-fill-mode",132],["animation-iteration-count",124],["animation-name",139],["animation-play-state",104],["animation-timing-function",141],["backface-visibility",123],["background",260],["background-attachment",119],["background-clip",165],["background-color",259],["background-image",246],["background-origin",107],["background-position",237],["background-position-x",108],["background-position-y",93],["background-repeat",234],["background-size",203],["border",263],["border-bottom",233],["border-bottom-color",190],["border-bottom-left-radius",186],["border-bottom-right-radius",185],["border-bottom-style",150],["border-bottom-width",179],["border-collapse",209],["border-color",226],["border-image",89],["border-image-outset",50],["border-image-repeat",49],["border-image-slice",58],["border-image-source",32],["border-image-width",52],["border-left",221],["border-left-color",174],["border-left-style",142],["border-left-width",172],["border-radius",224],["border-right",223],["border-right-color",182],["border-right-style",130],["border-right-width",178],["border-spacing",198],["border-style",206],["border-top",231],["border-top-color",192],["border-top-left-radius",187],["border-top-right-radius",189],["border-top-style",152],["border-top-width",180],["border-width",214],["bottom",227],["box-shadow",213],["box-sizing",216],["caption-side",96],["clear",229],["clip",173],["clip-rule",5],["color",256],["content",219],["counter-increment",111],["counter-reset",110],["cursor",250],["direction",176],["display",262],["empty-cells",99],["fill",140],["fill-opacity",82],["fill-rule",22],["filter",160],["flex",133],["flex-basis",66],["flex-direction",85],["flex-flow",94],["flex-grow",112],["flex-shrink",61],["flex-wrap",68],["float",252],["font",211],["font-family",254],["font-kerning",18],["font-size",264],["font-stretch",77],["font-style",220],["font-variant",161],["font-weight",257],["height",266],["image-rendering",90],["justify-content",127],["left",248],["letter-spacing",188],["line-height",244],["list-style",215],["list-style-image",145],["list-style-position",149],["list-style-type",199],["margin",267],["margin-bottom",241],["margin-left",243],["margin-right",238],["margin-top",253],["mask",20],["max-height",205],["max-width",225],["min-height",217],["min-width",218],["object-fit",33],["opacity",251],["order",117],["orphans",146],["outline",222],["outline-color",153],["outline-offset",147],["outline-style",151],["outline-width",148],["overflow",255],["overflow-wrap",105],["overflow-x",184],["overflow-y",196],["padding",265],["padding-bottom",230],["padding-left",235],["padding-right",232],["padding-top",240],["page",8],["page-break-after",120],["page-break-before",69],["page-break-inside",121],["perspective",92],["perspective-origin",103],["pointer-events",183],["position",261],["quotes",158],["resize",168],["right",245],["shape-rendering",38],["size",64],["speak",118],["src",170],["stop-color",42],["stop-opacity",31],["stroke",98],["stroke-dasharray",36],["stroke-dashoffset",3],["stroke-linecap",30],["stroke-linejoin",21],["stroke-miterlimit",12],["stroke-opacity",34],["stroke-width",87],["table-layout",171],["tab-size",46],["text-align",260],["text-anchor",35],["text-decoration",247],["text-indent",207],["text-overflow",204],["text-rendering",155],["text-shadow",208],["text-transform",202],["top",258],["touch-action",80],["transform",181],["transform-origin",162],["transform-style",86],["transition",193],["transition-delay",134],["transition-duration",135],["transition-property",131],["transition-timing-function",122],["unicode-bidi",156],["unicode-range",136],["vertical-align",236],["visibility",242],["-webkit-appearance",191],["-webkit-backface-visibility",154],["-webkit-background-clip",164],["-webkit-background-origin",40],["-webkit-background-size",163],["-webkit-border-end",9],["-webkit-border-horizontal-spacing",81],["-webkit-border-image",75],["-webkit-border-radius",212],["-webkit-border-start",10],["-webkit-border-start-color",16],["-webkit-border-start-width",13],["-webkit-border-vertical-spacing",43],["-webkit-box-align",101],["-webkit-box-direction",51],["-webkit-box-flex",128],["-webkit-box-ordinal-group",91],["-webkit-box-orient",144],["-webkit-box-pack",106],["-webkit-box-reflect",39],["-webkit-box-shadow",210],["-webkit-column-break-inside",60],["-webkit-column-count",84],["-webkit-column-gap",76],["-webkit-column-rule",25],["-webkit-column-rule-color",23],["-webkit-columns",44],["-webkit-column-span",29],["-webkit-column-width",47],["-webkit-filter",159],["-webkit-font-feature-settings",59],["-webkit-font-smoothing",177],["-webkit-highlight",1],["-webkit-line-break",45],["-webkit-line-clamp",126],["-webkit-margin-after",67],["-webkit-margin-before",70],["-webkit-margin-collapse",14],["-webkit-margin-end",65],["-webkit-margin-start",100],["-webkit-margin-top-collapse",78],["-webkit-mask",19],["-webkit-mask-box-image",72],["-webkit-mask-image",88],["-webkit-mask-position",54],["-webkit-mask-repeat",63],["-webkit-mask-size",79],["-webkit-padding-after",15],["-webkit-padding-before",28],["-webkit-padding-end",48],["-webkit-padding-start",73],["-webkit-print-color-adjust",83],["-webkit-rtl-ordering",7],["-webkit-tap-highlight-color",169],["-webkit-text-emphasis-color",11],["-webkit-text-fill-color",71],["-webkit-text-security",17],["-webkit-text-stroke",56],["-webkit-text-stroke-color",37],["-webkit-text-stroke-width",53],["-webkit-user-drag",95],["-webkit-user-modify",62],["-webkit-user-select",194],["-webkit-writing-mode",4],["white-space",228],["widows",115],["width",268],["will-change",74],["word-break",166],["word-spacing",157],["word-wrap",197],["writing-mode",41],["z-index",239],["zoom",200]]),L=["auto","none"];var E=Object.freeze({__proto__:null,CSSMetadata:m,VariableRegex:f,CustomVariableRegex:/(var\(*--[\w\d]+-([\w]+-[\w]+)\))/g,URLRegex:/url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g,GridAreaRowRegex:b,cssMetadata:v});class A{callFrame;callUID;self;total;id;parent;children;functionName;depth;deoptReason;#h;constructor(e,t){this.callFrame=e,this.callUID=`${e.functionName}@${e.scriptId}:${e.lineNumber}:${e.columnNumber}`,this.self=0,this.total=0,this.id=0,this.functionName=e.functionName,this.parent=null,this.children=[],this.#h=t}get scriptId(){return String(this.callFrame.scriptId)}get url(){return this.callFrame.url}get lineNumber(){return this.callFrame.lineNumber}get columnNumber(){return this.callFrame.columnNumber}setFunctionName(e){null!==e&&(this.functionName=e)}target(){return this.#h}}class O{#e;root;total;maxDepth;constructor(e){this.#e=e||null}initialize(e){this.root=e,this.assignDepthsAndParents(),this.total=this.calculateTotals(this.root)}assignDepthsAndParents(){const e=this.root;e.depth=-1,e.parent=null,this.maxDepth=0;const t=[e];for(;t.length;){const e=t.pop(),n=e.depth+1;n>this.maxDepth&&(this.maxDepth=n);const r=e.children;for(const s of r)s.depth=n,s.parent=e,s.children.length&&t.push(s)}}calculateTotals(e){const t=[e],n=[];for(;t.length;){const e=t.pop();e.total=e.self,n.push(e),t.push(...e.children)}for(;n.length>1;){const e=n.pop();e.parent&&(e.parent.total+=e.total)}return e.total}target(){return this.#e}}var N=Object.freeze({__proto__:null,ProfileNode:A,ProfileTreeModel:O});class F{#u;#g;#p;#m;#f;#b;#y;constructor(e,t,n,r){this.#u=e,this.#g=t,this.#p=n,this.#m={},this.#f=0,this.#b=r||"Medium",this.#y=null}static fromProtocolCookie(e){const t=new F(e.name,e.value,null,e.priority);return t.addAttribute("domain",e.domain),t.addAttribute("path",e.path),e.expires&&t.addAttribute("expires",1e3*e.expires),e.httpOnly&&t.addAttribute("httpOnly"),e.secure&&t.addAttribute("secure"),e.sameSite&&t.addAttribute("sameSite",e.sameSite),"sourcePort"in e&&t.addAttribute("sourcePort",e.sourcePort),"sourceScheme"in e&&t.addAttribute("sourceScheme",e.sourceScheme),"partitionKey"in e&&t.addAttribute("partitionKey",e.partitionKey),"partitionKeyOpaque"in e&&t.addAttribute("partitionKey","<opaque>"),t.setSize(e.size),t}key(){return(this.domain()||"-")+" "+this.name()+" "+(this.path()||"-")}name(){return this.#u}value(){return this.#g}type(){return this.#p}httpOnly(){return"httponly"in this.#m}secure(){return"secure"in this.#m}sameSite(){return this.#m.samesite}partitionKey(){return this.#m.partitionkey}setPartitionKey(e){this.addAttribute("partitionKey",e)}partitionKeyOpaque(){return"<opaque>"===this.#m.partitionkey}setPartitionKeyOpaque(){this.addAttribute("partitionKey","<opaque>")}priority(){return this.#b}session(){return!("expires"in this.#m||"max-age"in this.#m)}path(){return this.#m.path}domain(){return this.#m.domain}expires(){return this.#m.expires}maxAge(){return this.#m["max-age"]}sourcePort(){return this.#m.sourceport}sourceScheme(){return this.#m.sourcescheme}size(){return this.#f}url(){if(!this.domain()||!this.path())return null;let e="";const t=this.sourcePort();return t&&80!==t&&443!==t&&(e=`:${this.sourcePort()}`),(this.secure()?"https://":"http://")+this.domain()+e+this.path()}setSize(e){this.#f=e}expiresDate(e){return this.maxAge()?new Date(e.getTime()+1e3*this.maxAge()):this.expires()?new Date(this.expires()):null}addAttribute(e,t){const n=e.toLowerCase();if("priority"===n)this.#b=t;else this.#m[n]=t}setCookieLine(e){this.#y=e}getCookieLine(){return this.#y}matchesSecurityOrigin(e){const t=new URL(e).hostname;return F.isDomainMatch(this.domain(),t)}static isDomainMatch(e,t){return t===e||!(!e||"."!==e[0])&&(e.substr(1)===t||t.length>e.length&&t.endsWith(e))}}var B,D;!function(e){e[e.Request=0]="Request",e[e.Response=1]="Response"}(B||(B={})),function(e){e.Name="name",e.Value="value",e.Size="size",e.Domain="domain",e.Path="path",e.Expires="expires",e.HttpOnly="httpOnly",e.Secure="secure",e.SameSite="sameSite",e.SourceScheme="sourceScheme",e.SourcePort="sourcePort",e.Priority="priority",e.PartitionKey="partitionKey"}(D||(D={}));var U=Object.freeze({__proto__:null,Cookie:F,get Type(){return B},get Attributes(){return D}});class H{#v;#I;#k;#S;#w;#C;#T;constructor(e){e&&(this.#v=e.toLowerCase().replace(/^\./,"")),this.#I=[],this.#S=0}static parseSetCookie(e,t){return new H(t).parseSetCookie(e)}cookies(){return this.#I}parseSetCookie(e){if(!this.initialize(e))return null;for(let e=this.extractKeyValue();e;e=this.extractKeyValue())this.#w?this.#w.addAttribute(e.key,e.value):this.addCookie(e,B.Response),this.advanceAndCheckCookieDelimiter()&&this.flushCookie();return this.flushCookie(),this.#I}initialize(e){return this.#k=e,"string"==typeof e&&(this.#I=[],this.#w=null,this.#C="",this.#S=this.#k.length,!0)}flushCookie(){this.#w&&(this.#w.setSize(this.#S-this.#k.length-this.#T),this.#w.setCookieLine(this.#C.replace("\n",""))),this.#w=null,this.#C=""}extractKeyValue(){if(!this.#k||!this.#k.length)return null;const e=/^[ \t]*([^=;]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this.#k);if(!e)return console.error("Failed parsing cookie header before: "+this.#k),null;const t=new q(e[1]&&e[1].trim(),e[2]&&e[2].trim(),this.#S-this.#k.length);return this.#C+=e[0],this.#k=this.#k.slice(e[0].length),t}advanceAndCheckCookieDelimiter(){if(!this.#k)return!1;const e=/^\s*[\n;]\s*/.exec(this.#k);return!!e&&(this.#C+=e[0],this.#k=this.#k.slice(e[0].length),null!==e[0].match("\n"))}addCookie(e,t){this.#w&&this.#w.setSize(e.position-this.#T),this.#w="string"==typeof e.value?new F(e.key,e.value,t):new F("",e.key,t),this.#v&&this.#w.addAttribute("domain",this.#v),this.#T=e.position,this.#I.push(this.#w)}}class q{key;value;position;constructor(e,t,n){this.key=e,this.value=t,this.position=n}}var _,z,j=Object.freeze({__proto__:null,CookieParser:H});class W extends a.InspectorBackend.TargetBase{#R;#u;#x;#M;#P;#p;#L;#E;#A;#O;#N;#F;constructor(e,n,r,s,i,a,o,l,d){switch(super(s===_.Node,i,a,l),this.#R=e,this.#u=r,this.#x=t.DevToolsPath.EmptyUrlString,this.#M="",this.#P=0,s){case _.Frame:this.#P=z.Browser|z.Storage|z.DOM|z.JS|z.Log|z.Network|z.Target|z.Tracing|z.Emulation|z.Input|z.Inspector|z.Audits|z.WebAuthn|z.IO|z.Media,i?.type()!==_.Frame&&(this.#P|=z.DeviceEmulation|z.ScreenCapture|z.Security|z.ServiceWorker,d?.url.startsWith("chrome-extension://")&&(this.#P&=~z.Security));break;case _.ServiceWorker:this.#P=z.JS|z.Log|z.Network|z.Target|z.Inspector|z.IO,i?.type()!==_.Frame&&(this.#P|=z.Browser);break;case _.SharedWorker:this.#P=z.JS|z.Log|z.Network|z.Target|z.IO|z.Media|z.Inspector;break;case _.Worker:this.#P=z.JS|z.Log|z.Network|z.Target|z.IO|z.Media|z.Emulation;break;case _.Node:this.#P=z.JS;break;case _.AuctionWorklet:this.#P=z.JS|z.EventBreakpoints;break;case _.Browser:this.#P=z.Target|z.IO;break;case _.Tab:this.#P=z.Target}this.#p=s,this.#L=i,this.#E=n,this.#A=new Map,this.#O=o,this.#N=d}createModels(e){this.#F=!0;const t=Array.from(c.registeredModels.entries());for(const[e,n]of t)n.early&&this.model(e);for(const[n,r]of t)(r.autostart||e.has(n))&&this.model(n);this.#F=!1}id(){return this.#E}name(){return this.#u||this.#M}setName(e){this.#u!==e&&(this.#u=e,this.#R.onNameChange(this))}type(){return this.#p}markAsNodeJSForTest(){super.markAsNodeJSForTest(),this.#p=_.Node}targetManager(){return this.#R}hasAllCapabilities(e){return(this.#P&e)===e}decorateLabel(e){return this.#p===_.Worker||this.#p===_.ServiceWorker?"⚙ "+e:e}parentTarget(){return this.#L}outermostTarget(){let e=null,t=this;do{t.type()!==_.Tab&&t.type()!==_.Browser&&(e=t),t=t.parentTarget()}while(t);return e}dispose(e){super.dispose(e),this.#R.removeTarget(this);for(const e of this.#A.values())e.dispose()}model(e){if(!this.#A.get(e)){const t=c.registeredModels.get(e);if(void 0===t)throw"Model class is not registered @"+(new Error).stack;if((this.#P&t.capabilities)===t.capabilities){const t=new e(this);this.#A.set(e,t),this.#F||this.#R.modelAdded(this,e,t,this.#R.isInScope(this))}}return this.#A.get(e)||null}models(){return this.#A}inspectedURL(){return this.#x}setInspectedURL(n){this.#x=n;const r=e.ParsedURL.ParsedURL.fromString(n);this.#M=r?r.lastPathComponentWithFragment():"#"+this.#E,this.parentTarget()?.type()!==_.Frame&&i.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(n||t.DevToolsPath.EmptyUrlString),this.#R.onInspectedURLChange(this),this.#u||this.#R.onNameChange(this)}async suspend(e){this.#O||(this.#O=!0,await Promise.all(Array.from(this.models().values(),(t=>t.preSuspendModel(e)))),await Promise.all(Array.from(this.models().values(),(t=>t.suspendModel(e)))))}async resume(){this.#O&&(this.#O=!1,await Promise.all(Array.from(this.models().values(),(e=>e.resumeModel()))),await Promise.all(Array.from(this.models().values(),(e=>e.postResumeModel()))))}suspended(){return this.#O}updateTargetInfo(e){this.#N=e}targetInfo(){return this.#N}}!function(e){e.Frame="frame",e.ServiceWorker="service-worker",e.Worker="worker",e.SharedWorker="shared-worker",e.Node="node",e.Browser="browser",e.AuctionWorklet="auction-worklet",e.Tab="tab"}(_||(_={})),function(e){e[e.Browser=1]="Browser",e[e.DOM=2]="DOM",e[e.JS=4]="JS",e[e.Log=8]="Log",e[e.Network=16]="Network",e[e.Target=32]="Target",e[e.ScreenCapture=64]="ScreenCapture",e[e.Tracing=128]="Tracing",e[e.Emulation=256]="Emulation",e[e.Security=512]="Security",e[e.Input=1024]="Input",e[e.Inspector=2048]="Inspector",e[e.DeviceEmulation=4096]="DeviceEmulation",e[e.Storage=8192]="Storage",e[e.ServiceWorker=16384]="ServiceWorker",e[e.Audits=32768]="Audits",e[e.WebAuthn=65536]="WebAuthn",e[e.IO=131072]="IO",e[e.Media=262144]="Media",e[e.EventBreakpoints=524288]="EventBreakpoints",e[e.None=0]="None"}(z||(z={}));var V=Object.freeze({__proto__:null,Target:W,get Type(){return _},get Capability(){return z}});let G;class K extends e.ObjectWrapper.ObjectWrapper{#B;#D;#U;#H;#q;#O;#_;#z;#j;#W;constructor(){super(),this.#B=new Set,this.#D=new Set,this.#U=new t.MapUtilities.Multimap,this.#H=new t.MapUtilities.Multimap,this.#O=!1,this.#_=null,this.#z=null,this.#q=new WeakSet,this.#j=!1,this.#W=new Set}static instance({forceNew:e}={forceNew:!1}){return G&&!e||(G=new K),G}static removeInstance(){G=void 0}onInspectedURLChange(e){this.dispatchEventToListeners($.InspectedURLChanged,e)}onNameChange(e){this.dispatchEventToListeners($.NameChanged,e)}async suspendAllTargets(e){if(this.#O)return;this.#O=!0,this.dispatchEventToListeners($.SuspendStateChanged);const t=Array.from(this.#B.values(),(t=>t.suspend(e)));await Promise.all(t)}async resumeAllTargets(){if(!this.#O)return;this.#O=!1,this.dispatchEventToListeners($.SuspendStateChanged);const e=Array.from(this.#B.values(),(e=>e.resume()));await Promise.all(e)}allTargetsSuspended(){return this.#O}models(e,t){const n=[];for(const r of this.#B){if(t?.scoped&&!this.isInScope(r))continue;const s=r.model(e);s&&n.push(s)}return n}inspectedURL(){const e=this.primaryPageTarget();return e?e.inspectedURL():""}observeModels(e,t,n){const r=this.models(e,n);this.#H.set(e,t),n?.scoped&&this.#q.add(t);for(const e of r)t.modelAdded(e)}unobserveModels(e,t){this.#H.delete(e,t),this.#q.delete(t)}modelAdded(e,t,n,r){for(const e of this.#H.get(t).values())this.#q.has(e)&&!r||e.modelAdded(n)}modelRemoved(e,t,n,r){for(const e of this.#H.get(t).values())this.#q.has(e)&&!r||e.modelRemoved(n)}addModelListener(e,t,n,r,s){const i=e=>{s?.scoped&&!this.isInScope(e)||n.call(r,e)};for(const n of this.models(e))n.addEventListener(t,i);this.#U.set(t,{modelClass:e,thisObject:r,listener:n,wrappedListener:i})}removeModelListener(e,t,n,r){if(!this.#U.has(t))return;let s=null;for(const i of this.#U.get(t))i.modelClass===e&&i.listener===n&&i.thisObject===r&&(s=i.wrappedListener,this.#U.delete(t,i));if(s)for(const n of this.models(e))n.removeEventListener(t,s)}observeTargets(e,t){if(this.#D.has(e))throw new Error("Observer can only be registered once");t?.scoped&&this.#q.add(e);for(const n of this.#B)t?.scoped&&!this.isInScope(n)||e.targetAdded(n);this.#D.add(e)}unobserveTargets(e){this.#D.delete(e),this.#q.delete(e)}createTarget(e,t,n,r,s,i,a,o){const l=new W(this,e,t,n,r,s||"",this.#O,a||null,o);i&&l.pageAgent().invoke_waitForDebugger(),l.createModels(new Set(this.#H.keysArray())),this.#B.add(l);const d=this.isInScope(l);for(const e of[...this.#D])this.#q.has(e)&&!d||e.targetAdded(l);for(const[e,t]of l.models().entries())this.modelAdded(l,e,t,d);for(const e of this.#U.keysArray())for(const t of this.#U.get(e)){const n=l.model(t.modelClass);n&&n.addEventListener(e,t.wrappedListener)}return l!==l.outermostTarget()||l.type()===_.Frame&&l!==this.primaryPageTarget()||this.#j||this.setScopeTarget(l),l}removeTarget(e){if(!this.#B.has(e))return;const t=this.isInScope(e);this.#B.delete(e);for(const r of e.models().keys()){const s=e.models().get(r);n(s),this.modelRemoved(e,r,s,t)}for(const n of[...this.#D])this.#q.has(n)&&!t||n.targetRemoved(e);for(const t of this.#U.keysArray())for(const n of this.#U.get(t)){const r=e.model(n.modelClass);r&&r.removeEventListener(t,n.wrappedListener)}}targets(){return[...this.#B]}targetById(e){return this.targets().find((t=>t.id()===e))||null}rootTarget(){return this.#B.size?this.#B.values().next().value:null}primaryPageTarget(){let e=this.rootTarget();return e?.type()===_.Tab&&(e=this.targets().find((t=>t.parentTarget()===e&&t.type()===_.Frame&&!t.targetInfo()?.subtype?.length))||null),e}browserTarget(){return this.#_}async maybeAttachInitialTarget(){if(!Boolean(o.Runtime.Runtime.queryParam("browserConnection")))return!1;this.#_||(this.#_=new W(this,"main","browser",_.Browser,null,"",!1,null,void 0),this.#_.createModels(new Set(this.#H.keysArray())));const e=await i.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId();return this.#_.targetAgent().invoke_autoAttachRelated({targetId:e,waitForDebuggerOnStart:!0}),!0}clearAllTargetsForTest(){this.#B.clear()}isInScope(e){if(!e)return!1;for(function(e){return"source"in e&&e.source instanceof c}(e)&&(e=e.source),e instanceof c&&(e=e.target());e&&e!==this.#z;)e=e.parentTarget();return Boolean(e)&&e===this.#z}setScopeTarget(e){if(e!==this.#z){for(const e of this.targets())if(this.isInScope(e)){for(const t of this.#H.keysArray()){const n=e.models().get(t);if(n)for(const e of[...this.#H.get(t)].filter((e=>this.#q.has(e))))e.modelRemoved(n)}for(const t of[...this.#D].filter((e=>this.#q.has(e))))t.targetRemoved(e)}this.#z=e;for(const e of this.targets())if(this.isInScope(e)){for(const t of[...this.#D].filter((e=>this.#q.has(e))))t.targetAdded(e);for(const[t,n]of e.models().entries())for(const e of[...this.#H.get(t)].filter((e=>this.#q.has(e))))e.modelAdded(n)}for(const e of this.#W)e()}}addScopeChangeListener(e){this.#W.add(e)}removeScopeChangeListener(e){this.#W.delete(e)}scopeTarget(){return this.#z}}var $;!function(e){e.AvailableTargetsChanged="AvailableTargetsChanged",e.InspectedURLChanged="InspectedURLChanged",e.NameChanged="NameChanged",e.SuspendStateChanged="SuspendStateChanged"}($||($={}));var Q=Object.freeze({__proto__:null,TargetManager:K,get Events(){return $},Observer:class{targetAdded(e){}targetRemoved(e){}},SDKModelObserver:class{modelAdded(e){}modelRemoved(e){}}});const X={noContentForWebSocket:"Content for WebSockets is currently not supported",noContentForRedirect:"No content available because this request was redirected",noContentForPreflight:"No content available for preflight request",noThrottling:"No throttling",offline:"Offline",slowG:"Slow 3G",fastG:"Fast 3G",requestWasBlockedByDevtoolsS:'Request was blocked by DevTools: "{PH1}"',crossoriginReadBlockingCorb:"Cross-Origin Read Blocking (CORB) blocked cross-origin response {PH1} with MIME type {PH2}. See https://www.chromestatus.com/feature/5629709824032768 for more details.",sFailedLoadingSS:'{PH1} failed loading: {PH2} "{PH3}".',sFinishedLoadingSS:'{PH1} finished loading: {PH2} "{PH3}".'},J=s.i18n.registerUIStrings("core/sdk/NetworkManager.ts",X),Y=s.i18n.getLocalizedString.bind(void 0,J),Z=s.i18n.getLazilyComputedLocalizedString.bind(void 0,J),ee=new WeakMap,te=new Map([["2g","cellular2g"],["3g","cellular3g"],["4g","cellular4g"],["bluetooth","bluetooth"],["wifi","wifi"],["wimax","wimax"]]);class ne extends c{dispatcher;fetchDispatcher;#V;#G;constructor(t){super(t),this.dispatcher=new ce(this),this.fetchDispatcher=new de(t.fetchAgent(),this),this.#V=t.networkAgent(),t.registerNetworkDispatcher(this.dispatcher),t.registerFetchDispatcher(this.fetchDispatcher),e.Settings.Settings.instance().moduleSetting("cacheDisabled").get()&&this.#V.invoke_setCacheDisabled({cacheDisabled:!0}),this.#V.invoke_enable({maxPostDataSize:le}),this.#V.invoke_setAttachDebugStack({enabled:!0}),this.#G=e.Settings.Settings.instance().createSetting("bypassServiceWorker",!1),this.#G.get()&&this.bypassServiceWorkerChanged(),this.#G.addChangeListener(this.bypassServiceWorkerChanged,this),e.Settings.Settings.instance().moduleSetting("cacheDisabled").addChangeListener(this.cacheDisabledSettingChanged,this)}static forRequest(e){return ee.get(e)||null}static canReplayRequest(t){return Boolean(ee.get(t))&&Boolean(t.backendRequestId())&&!t.isRedirect()&&t.resourceType()===e.ResourceType.resourceTypes.XHR}static replayRequest(e){const t=ee.get(e),n=e.backendRequestId();t&&n&&!e.isRedirect()&&t.#V.invoke_replayXHR({requestId:n})}static async searchInRequest(e,t,n,r){const s=ne.forRequest(e),i=e.backendRequestId();if(!s||!i||e.isRedirect())return[];return(await s.#V.invoke_searchInResponseBody({requestId:i,query:t,caseSensitive:n,isRegex:r})).result||[]}static async requestContentData(t){if(t.resourceType()===e.ResourceType.resourceTypes.WebSocket)return{error:Y(X.noContentForWebSocket),content:null,encoded:!1};if(t.finished||await t.once(Te.FinishedLoading),t.isRedirect())return{error:Y(X.noContentForRedirect),content:null,encoded:!1};if(t.isPreflightRequest())return{error:Y(X.noContentForPreflight),content:null,encoded:!1};const n=ne.forRequest(t);if(!n)return{error:"No network manager for request",content:null,encoded:!1};const r=t.backendRequestId();if(!r)return{error:"No backend request id for request",content:null,encoded:!1};const s=await n.#V.invoke_getResponseBody({requestId:r}),i=s.getError()||null;return{error:i,content:i?null:s.body,encoded:s.base64Encoded}}static async requestPostData(e){const t=ne.forRequest(e);if(!t)return console.error("No network manager for request"),null;const n=e.backendRequestId();if(!n)return console.error("No backend request id for request"),null;try{const{postData:e}=await t.#V.invoke_getRequestPostData({requestId:n});return e}catch(e){return e.message}}static connectionType(e){if(!e.download&&!e.upload)return"none";const t="function"==typeof e.title?e.title().toLowerCase():e.title.toLowerCase();for(const[e,n]of te)if(t.includes(e))return n;return"other"}static lowercaseHeaders(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}requestForURL(e){return this.dispatcher.requestForURL(e)}requestForId(e){return this.dispatcher.requestForId(e)}requestForLoaderId(e){return this.dispatcher.requestForLoaderId(e)}cacheDisabledSettingChanged({data:e}){this.#V.invoke_setCacheDisabled({cacheDisabled:e})}dispose(){e.Settings.Settings.instance().moduleSetting("cacheDisabled").removeChangeListener(this.cacheDisabledSettingChanged,this)}bypassServiceWorkerChanged(){this.#V.invoke_setBypassServiceWorker({bypass:this.#G.get()})}async getSecurityIsolationStatus(e){const t=await this.#V.invoke_getSecurityIsolationStatus({frameId:e??void 0});return t.getError()?null:t.status}async enableReportingApi(e=!0){return this.#V.invoke_enableReportingApi({enable:e})}async loadNetworkResource(e,t,n){const r=await this.#V.invoke_loadNetworkResource({frameId:e??void 0,url:t,options:n});if(r.getError())throw new Error(r.getError());return r.resource}clearRequests(){this.dispatcher.clearRequests()}}var re;!function(e){e.RequestStarted="RequestStarted",e.RequestUpdated="RequestUpdated",e.RequestFinished="RequestFinished",e.RequestUpdateDropped="RequestUpdateDropped",e.ResponseReceived="ResponseReceived",e.MessageGenerated="MessageGenerated",e.RequestRedirected="RequestRedirected",e.LoadingFinished="LoadingFinished",e.ReportingApiReportAdded="ReportingApiReportAdded",e.ReportingApiReportUpdated="ReportingApiReportUpdated",e.ReportingApiEndpointsChangedForOrigin="ReportingApiEndpointsChangedForOrigin"}(re||(re={}));const se={title:Z(X.noThrottling),i18nTitleKey:X.noThrottling,download:-1,upload:-1,latency:0},ie={title:Z(X.offline),i18nTitleKey:X.offline,download:0,upload:0,latency:0},ae={title:Z(X.slowG),i18nTitleKey:X.slowG,download:5e4,upload:5e4,latency:2e3},oe={title:Z(X.fastG),i18nTitleKey:X.fastG,download:18e4,upload:84375,latency:562.5},le=65536;class de{#K;#$;constructor(e,t){this.#K=e,this.#$=t}requestPaused({requestId:e,request:t,resourceType:n,responseStatusCode:r,responseHeaders:s,networkId:i}){const a=i?this.#$.requestForId(i):null;0===a?.originalResponseHeaders.length&&s&&(a.originalResponseHeaders=s),ue.instance().requestIntercepted(new ge(this.#K,t,n,e,a,r,s))}authRequired({}){}}class ce{#$;#Q;#X;#J;#Y;#Z;constructor(e){this.#$=e,this.#Q=new Map,this.#X=new Map,this.#J=new Map,this.#Y=new Map,this.#Z=new Map,ue.instance().addEventListener(ue.Events.RequestIntercepted,this.#ee.bind(this))}#ee(e){const t=this.requestForId(e.data);t&&t.setWasIntercepted(!0)}headersMapToHeadersArray(e){const t=[];for(const n in e){const r=e[n].split("\n");for(let e=0;e<r.length;++e)t.push({name:n,value:r[e]})}return t}updateNetworkRequestWithRequest(e,t){e.requestMethod=t.method,e.setRequestHeaders(this.headersMapToHeadersArray(t.headers)),e.setRequestFormData(Boolean(t.hasPostData),t.postData||null),e.setInitialPriority(t.initialPriority),e.mixedContentType=t.mixedContentType||"none",e.setReferrerPolicy(t.referrerPolicy),e.setIsSameSite(t.isSameSite||!1)}updateNetworkRequestWithResponse(t,n){n.url&&t.url()!==n.url&&t.setUrl(n.url),t.mimeType=n.mimeType,t.statusCode&&!t.wasIntercepted()||(t.statusCode=n.status),t.statusText&&!t.wasIntercepted()||(t.statusText=n.statusText),t.hasExtraResponseInfo()&&!t.wasIntercepted()||(t.responseHeaders=this.headersMapToHeadersArray(n.headers)),n.encodedDataLength>=0&&t.setTransferSize(n.encodedDataLength),n.requestHeaders&&!t.hasExtraRequestInfo()&&(t.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),t.setRequestHeadersText(n.requestHeadersText||"")),t.connectionReused=n.connectionReused,t.connectionId=String(n.connectionId),n.remoteIPAddress&&t.setRemoteAddress(n.remoteIPAddress,n.remotePort||-1),n.fromServiceWorker&&(t.fetchedViaServiceWorker=!0),n.fromDiskCache&&t.setFromDiskCache(),n.fromPrefetchCache&&t.setFromPrefetchCache(),n.cacheStorageCacheName&&t.setResponseCacheStorageCacheName(n.cacheStorageCacheName),n.responseTime&&t.setResponseRetrievalTime(new Date(n.responseTime)),t.timing=n.timing,t.protocol=n.protocol||"",t.alternateProtocolUsage=n.alternateProtocolUsage,n.serviceWorkerResponseSource&&t.setServiceWorkerResponseSource(n.serviceWorkerResponseSource),t.setSecurityState(n.securityState),n.securityDetails&&t.setSecurityDetails(n.securityDetails);const r=e.ResourceType.ResourceType.fromMimeTypeOverride(t.mimeType);r&&t.setResourceType(r)}requestForId(e){return this.#Q.get(e)||null}requestForURL(e){return this.#X.get(e)||null}requestForLoaderId(e){return this.#J.get(e)||null}resourceChangedPriority({requestId:e,newPriority:t}){const n=this.#Q.get(e);n&&n.setPriority(t)}signedExchangeReceived({requestId:t,info:n}){let r=this.#Q.get(t);(r||(r=this.#X.get(n.outerResponse.url),r))&&(r.setSignedExchangeInfo(n),r.setResourceType(e.ResourceType.resourceTypes.SignedExchange),this.updateNetworkRequestWithResponse(r,n.outerResponse),this.updateNetworkRequest(r),this.#$.dispatchEventToListeners(re.ResponseReceived,{request:r,response:n.outerResponse}))}requestWillBeSent({requestId:t,loaderId:n,documentURL:r,request:s,timestamp:i,wallTime:a,initiator:o,redirectResponse:l,type:d,frameId:c,hasUserGesture:h}){let u=this.#Q.get(t);if(u){if(!l)return;u.signedExchangeInfo()||this.responseReceived({requestId:t,loaderId:n,timestamp:i,type:d||"Other",response:l,hasExtraInfo:!1,frameId:c}),u=this.appendRedirect(t,i,s.url),this.#$.dispatchEventToListeners(re.RequestRedirected,u)}else u=Me.create(t,s.url,r,c??null,n,o,h),ee.set(u,this.#$);u.hasNetworkData=!0,this.updateNetworkRequestWithRequest(u,s),u.setIssueTime(i,a),u.setResourceType(d?e.ResourceType.resourceTypes[d]:e.ResourceType.resourceTypes.Other),s.trustTokenParams&&u.setTrustTokenParams(s.trustTokenParams);const g=this.#Z.get(t);g&&(u.setTrustTokenOperationDoneEvent(g),this.#Z.delete(t)),this.getExtraInfoBuilder(t).addRequest(u),this.startNetworkRequest(u,s)}requestServedFromCache({requestId:e}){const t=this.#Q.get(e);t&&t.setFromMemoryCache()}responseReceived({requestId:t,loaderId:n,timestamp:r,type:s,response:i,frameId:a}){const o=this.#Q.get(t),l=ne.lowercaseHeaders(i.headers);if(o)o.responseReceivedTime=r,o.setResourceType(e.ResourceType.resourceTypes[s]),this.updateNetworkRequestWithResponse(o,i),this.updateNetworkRequest(o),this.#$.dispatchEventToListeners(re.ResponseReceived,{request:o,response:i});else{const e=l["last-modified"],t={url:i.url,frameId:a??null,loaderId:n,resourceType:s,mimeType:i.mimeType,lastModified:e?new Date(e):null};this.#$.dispatchEventToListeners(re.RequestUpdateDropped,t)}}dataReceived({requestId:e,timestamp:t,dataLength:n,encodedDataLength:r}){let s=this.#Q.get(e);s||(s=this.maybeAdoptMainResourceRequest(e)),s&&(s.resourceSize+=n,-1!==r&&s.increaseTransferSize(r),s.endTime=t,this.updateNetworkRequest(s))}loadingFinished({requestId:e,timestamp:t,encodedDataLength:n,shouldReportCorbBlocking:r}){let s=this.#Q.get(e);s||(s=this.maybeAdoptMainResourceRequest(e)),s&&(this.getExtraInfoBuilder(e).finished(),this.finishNetworkRequest(s,t,n,r),this.#$.dispatchEventToListeners(re.LoadingFinished,s))}loadingFailed({requestId:t,timestamp:n,type:r,errorText:s,canceled:i,blockedReason:a,corsErrorStatus:o}){const l=this.#Q.get(t);if(l){if(l.failed=!0,l.setResourceType(e.ResourceType.resourceTypes[r]),l.canceled=Boolean(i),a&&(l.setBlockedReason(a),"inspector"===a)){const e=Y(X.requestWasBlockedByDevtoolsS,{PH1:l.url()});this.#$.dispatchEventToListeners(re.MessageGenerated,{message:e,requestId:t,warning:!0})}o&&l.setCorsErrorStatus(o),l.localizedFailDescription=s,this.getExtraInfoBuilder(t).finished(),this.finishNetworkRequest(l,n,-1)}}webSocketCreated({requestId:t,url:n,initiator:r}){const s=Me.createForWebSocket(t,n,r);ee.set(s,this.#$),s.setResourceType(e.ResourceType.resourceTypes.WebSocket),this.startNetworkRequest(s,null)}webSocketWillSendHandshakeRequest({requestId:e,timestamp:t,wallTime:n,request:r}){const s=this.#Q.get(e);s&&(s.requestMethod="GET",s.setRequestHeaders(this.headersMapToHeadersArray(r.headers)),s.setIssueTime(t,n),this.updateNetworkRequest(s))}webSocketHandshakeResponseReceived({requestId:e,timestamp:t,response:n}){const r=this.#Q.get(e);r&&(r.statusCode=n.status,r.statusText=n.statusText,r.responseHeaders=this.headersMapToHeadersArray(n.headers),r.responseHeadersText=n.headersText||"",n.requestHeaders&&r.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),n.requestHeadersText&&r.setRequestHeadersText(n.requestHeadersText),r.responseReceivedTime=t,r.protocol="websocket",this.updateNetworkRequest(r))}webSocketFrameReceived({requestId:e,timestamp:t,response:n}){const r=this.#Q.get(e);r&&(r.addProtocolFrame(n,t,!1),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameSent({requestId:e,timestamp:t,response:n}){const r=this.#Q.get(e);r&&(r.addProtocolFrame(n,t,!0),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameError({requestId:e,timestamp:t,errorMessage:n}){const r=this.#Q.get(e);r&&(r.addProtocolFrameError(n,t),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketClosed({requestId:e,timestamp:t}){const n=this.#Q.get(e);n&&this.finishNetworkRequest(n,t,-1)}eventSourceMessageReceived({requestId:e,timestamp:t,eventName:n,eventId:r,data:s}){const i=this.#Q.get(e);i&&i.addEventSourceMessage(t,n,r,s)}requestIntercepted({}){}requestWillBeSentExtraInfo({requestId:e,associatedCookies:t,headers:n,clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i}){const a=[],o=[];for(const{blockedReasons:e,cookie:n}of t)0===e.length?o.push(F.fromProtocolCookie(n)):a.push({blockedReasons:e,cookie:F.fromProtocolCookie(n)});const l={blockedRequestCookies:a,includedRequestCookies:o,requestHeaders:this.headersMapToHeadersArray(n),clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i};this.getExtraInfoBuilder(e).addRequestExtraInfo(l)}responseReceivedExtraInfo({requestId:e,blockedCookies:t,headers:n,headersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:a,cookiePartitionKeyOpaque:o}){const l={blockedResponseCookies:t.map((e=>({blockedReasons:e.blockedReasons,cookieLine:e.cookieLine,cookie:e.cookie?F.fromProtocolCookie(e.cookie):null}))),responseHeaders:this.headersMapToHeadersArray(n),responseHeadersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:a,cookiePartitionKeyOpaque:o};this.getExtraInfoBuilder(e).addResponseExtraInfo(l)}getExtraInfoBuilder(e){let t;return this.#Y.has(e)?t=this.#Y.get(e):(t=new pe,this.#Y.set(e,t)),t}appendRedirect(e,t,n){const r=this.#Q.get(e);if(!r)throw new Error(`Could not find original network request for ${e}`);let s=0;for(let e=r.redirectSource();e;e=e.redirectSource())s++;r.markAsRedirect(s),this.finishNetworkRequest(r,t,-1);const i=Me.create(e,n,r.documentURL,r.frameId,r.loaderId,r.initiator(),r.hasUserGesture()??void 0);return ee.set(i,this.#$),i.setRedirectSource(r),r.setRedirectDestination(i),i}maybeAdoptMainResourceRequest(e){const t=ue.instance().inflightMainResourceRequests.get(e);if(!t)return null;const n=ne.forRequest(t).dispatcher;n.#Q.delete(e),n.#X.delete(t.url());const r=t.loaderId;r&&n.#J.delete(r);const s=n.#Y.get(e);return n.#Y.delete(e),this.#Q.set(e,t),this.#X.set(t.url(),t),r&&this.#J.set(r,t),s&&this.#Y.set(e,s),ee.set(t,this.#$),t}startNetworkRequest(e,t){this.#Q.set(e.requestId(),e),this.#X.set(e.url(),e);const n=e.loaderId;n&&this.#J.set(n,e),e.loaderId===e.requestId()&&ue.instance().inflightMainResourceRequests.set(e.requestId(),e),this.#$.dispatchEventToListeners(re.RequestStarted,{request:e,originalRequest:t})}updateNetworkRequest(e){this.#$.dispatchEventToListeners(re.RequestUpdated,e)}finishNetworkRequest(t,n,r,s){if(t.endTime=n,t.finished=!0,r>=0){const e=t.redirectSource();e&&e.signedExchangeInfo()?(t.setTransferSize(0),e.setTransferSize(r),this.updateNetworkRequest(e)):t.setTransferSize(r)}if(this.#$.dispatchEventToListeners(re.RequestFinished,t),ue.instance().inflightMainResourceRequests.delete(t.requestId()),s){const e=Y(X.crossoriginReadBlockingCorb,{PH1:t.url(),PH2:t.mimeType});this.#$.dispatchEventToListeners(re.MessageGenerated,{message:e,requestId:t.requestId(),warning:!0})}if(e.Settings.Settings.instance().moduleSetting("monitoringXHREnabled").get()&&t.resourceType().category()===e.ResourceType.resourceCategories.XHR){let e;const n=t.failed||t.hasErrorStatusCode();e=Y(n?X.sFailedLoadingSS:X.sFinishedLoadingSS,{PH1:t.resourceType().title(),PH2:t.requestMethod,PH3:t.url()}),this.#$.dispatchEventToListeners(re.MessageGenerated,{message:e,requestId:t.requestId(),warning:!1})}}clearRequests(){for(const[e,t]of this.#Q)t.finished&&this.#Q.delete(e);for(const[e,t]of this.#X)t.finished&&this.#X.delete(e);for(const[e,t]of this.#J)t.finished&&this.#J.delete(e);for(const[e,t]of this.#Y)t.isFinished()&&this.#Y.delete(e)}webTransportCreated({transportId:t,url:n,timestamp:r,initiator:s}){const i=Me.createForWebSocket(t,n,s);i.hasNetworkData=!0,ee.set(i,this.#$),i.setResourceType(e.ResourceType.resourceTypes.WebTransport),i.setIssueTime(r,0),this.startNetworkRequest(i,null)}webTransportConnectionEstablished({transportId:e,timestamp:t}){const n=this.#Q.get(e);n&&(n.responseReceivedTime=t,n.endTime=t+.001,this.updateNetworkRequest(n))}webTransportClosed({transportId:e,timestamp:t}){const n=this.#Q.get(e);n&&(n.endTime=t,this.finishNetworkRequest(n,t,0))}trustTokenOperationDone(e){const t=this.#Q.get(e.requestId);t?t.setTrustTokenOperationDoneEvent(e):this.#Z.set(e.requestId,e)}subresourceWebBundleMetadataReceived({requestId:e,urls:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({resourceUrls:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleMetadataError({requestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseParsed({innerRequestId:e,bundleRequestId:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({bundleRequestId:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseError({innerRequestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}reportingApiReportAdded(e){this.#$.dispatchEventToListeners(re.ReportingApiReportAdded,e.report)}reportingApiReportUpdated(e){this.#$.dispatchEventToListeners(re.ReportingApiReportUpdated,e.report)}reportingApiEndpointsChangedForOrigin(e){this.#$.dispatchEventToListeners(re.ReportingApiEndpointsChangedForOrigin,e)}createNetworkRequest(e,t,n,r,s,i){const a=Me.create(e,r,s,t,n,i);return ee.set(a,this.#$),a}}let he;class ue extends e.ObjectWrapper.ObjectWrapper{#te;#ne;#re;#se;#ie;inflightMainResourceRequests;#ae;#oe;#le;#de;#ce;#he;#ue;#ge;constructor(){super(),this.#te="",this.#ne=null,this.#re=null,this.#se=new Set,this.#ie=new Set,this.inflightMainResourceRequests=new Map,this.#ae=se,this.#oe=null,this.#le=e.Settings.Settings.instance().moduleSetting("requestBlockingEnabled"),this.#de=e.Settings.Settings.instance().createSetting("networkBlockedPatterns",[]),this.#ce=[],this.updateBlockedPatterns(),this.#he=new t.MapUtilities.Multimap,K.instance().observeModels(ne,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return he&&!t||(he=new ue),he}static dispose(){he=null}static getChromeVersion(){const e=navigator.userAgent.match(/(?:^|\W)(?:Chrome|HeadlessChrome)\/(\S+)/);return e&&e.length>1?e[1]:""}static patchUserAgentWithChromeVersion(e){const n=ue.getChromeVersion();if(n.length>0){const r=n.split(".",1)[0]+".0.100.0";return t.StringUtilities.sprintf(e,n,r)}return e}static patchUserAgentMetadataWithChromeVersion(e){if(!e.brands)return;const n=ue.getChromeVersion();if(0===n.length)return;const r=n.split(".",1)[0];for(const n of e.brands)n.version.includes("%s")&&(n.version=t.StringUtilities.sprintf(n.version,r));e.fullVersion&&e.fullVersion.includes("%s")&&(e.fullVersion=t.StringUtilities.sprintf(e.fullVersion,n))}modelAdded(e){const t=e.target().networkAgent(),n=e.target().fetchAgent();this.#ue&&t.invoke_setExtraHTTPHeaders({headers:this.#ue}),this.currentUserAgent()&&t.invoke_setUserAgentOverride({userAgent:this.currentUserAgent(),userAgentMetadata:this.#ne||void 0}),this.#ce.length&&t.invoke_setBlockedURLs({urls:this.#ce}),this.isIntercepting()&&n.invoke_enable({patterns:this.#he.valuesArray()}),null===this.#re?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:this.#re}),this.#se.add(t),this.#ie.add(n),this.isThrottling()&&this.updateNetworkConditions(t)}modelRemoved(e){for(const t of this.inflightMainResourceRequests){ne.forRequest(t[1])===e&&this.inflightMainResourceRequests.delete(t[0])}this.#se.delete(e.target().networkAgent()),this.#ie.delete(e.target().fetchAgent())}isThrottling(){return this.#ae.download>=0||this.#ae.upload>=0||this.#ae.latency>0}isOffline(){return!this.#ae.download&&!this.#ae.upload}setNetworkConditions(e){this.#ae=e;for(const e of this.#se)this.updateNetworkConditions(e);this.dispatchEventToListeners(ue.Events.ConditionsChanged)}networkConditions(){return this.#ae}updateNetworkConditions(e){const t=this.#ae;this.isThrottling()?e.invoke_emulateNetworkConditions({offline:this.isOffline(),latency:t.latency,downloadThroughput:t.download<0?0:t.download,uploadThroughput:t.upload<0?0:t.upload,connectionType:ne.connectionType(t)}):e.invoke_emulateNetworkConditions({offline:!1,latency:0,downloadThroughput:0,uploadThroughput:0})}setExtraHTTPHeaders(e){this.#ue=e;for(const e of this.#se)e.invoke_setExtraHTTPHeaders({headers:this.#ue})}currentUserAgent(){return this.#ge?this.#ge:this.#te}updateUserAgentOverride(){const e=this.currentUserAgent();for(const t of this.#se)t.invoke_setUserAgentOverride({userAgent:e,userAgentMetadata:this.#ne||void 0})}setUserAgentOverride(e,t){const n=this.#te!==e;this.#te=e,this.#ge?this.#ne=null:(this.#ne=t,this.updateUserAgentOverride()),n&&this.dispatchEventToListeners(ue.Events.UserAgentChanged)}userAgentOverride(){return this.#te}setCustomUserAgentOverride(e,t=null){this.#ge=e,this.#ne=t,this.updateUserAgentOverride()}setCustomAcceptedEncodingsOverride(e){this.#re=e,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners(ue.Events.AcceptedEncodingsChanged)}clearCustomAcceptedEncodingsOverride(){this.#re=null,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners(ue.Events.AcceptedEncodingsChanged)}isAcceptedEncodingOverrideSet(){return null!==this.#re}updateAcceptedEncodingsOverride(){const e=this.#re;for(const t of this.#se)null===e?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:e})}blockedPatterns(){return this.#de.get().slice()}blockingEnabled(){return this.#le.get()}isBlocking(){return Boolean(this.#ce.length)}setBlockedPatterns(e){this.#de.set(e),this.updateBlockedPatterns(),this.dispatchEventToListeners(ue.Events.BlockedPatternsChanged)}setBlockingEnabled(e){this.#le.get()!==e&&(this.#le.set(e),this.updateBlockedPatterns(),this.dispatchEventToListeners(ue.Events.BlockedPatternsChanged))}updateBlockedPatterns(){const e=[];if(this.#le.get())for(const t of this.#de.get())t.enabled&&e.push(t.url);if(e.length||this.#ce.length){this.#ce=e;for(const e of this.#se)e.invoke_setBlockedURLs({urls:this.#ce})}}isIntercepting(){return Boolean(this.#he.size)}setInterceptionHandlerForPatterns(e,t){this.#he.deleteAll(t);for(const n of e)this.#he.set(t,n);return this.updateInterceptionPatternsOnNextTick()}updateInterceptionPatternsOnNextTick(){return this.#oe||(this.#oe=Promise.resolve().then(this.updateInterceptionPatterns.bind(this))),this.#oe}async updateInterceptionPatterns(){e.Settings.Settings.instance().moduleSetting("cacheDisabled").get()||e.Settings.Settings.instance().moduleSetting("cacheDisabled").set(!0),this.#oe=null;const t=[];for(const e of this.#ie)t.push(e.invoke_enable({patterns:this.#he.valuesArray()}));this.dispatchEventToListeners(ue.Events.InterceptorsChanged),await Promise.all(t)}async requestIntercepted(e){for(const t of this.#he.keysArray())if(await t(e),e.hasResponded()&&e.networkRequest)return void this.dispatchEventToListeners(ue.Events.RequestIntercepted,e.networkRequest.requestId());e.hasResponded()||e.continueRequestWithoutChange()}clearBrowserCache(){for(const e of this.#se)e.invoke_clearBrowserCache()}clearBrowserCookies(){for(const e of this.#se)e.invoke_clearBrowserCookies()}async getCertificate(e){const t=K.instance().primaryPageTarget();if(!t)return[];const n=await t.networkAgent().invoke_getCertificate({origin:e});return n?n.tableNames:[]}async loadResource(t){const n={},r=this.currentUserAgent();r&&(n["User-Agent"]=r),e.Settings.Settings.instance().moduleSetting("cacheDisabled").get()&&(n["Cache-Control"]="no-cache");const s=e.Settings.Settings.instance().moduleSetting("network.enable-remote-file-loading").get();return new Promise((e=>i.ResourceLoader.load(t,n,((t,n,r,s)=>{e({success:t,content:r,errorDescription:s})}),s)))}}!function(e){let t;!function(e){e.BlockedPatternsChanged="BlockedPatternsChanged",e.ConditionsChanged="ConditionsChanged",e.UserAgentChanged="UserAgentChanged",e.InterceptorsChanged="InterceptorsChanged",e.AcceptedEncodingsChanged="AcceptedEncodingsChanged",e.RequestIntercepted="RequestIntercepted",e.RequestFulfilled="RequestFulfilled"}(t=e.Events||(e.Events={}))}(ue||(ue={}));class ge{#K;#pe;request;resourceType;responseStatusCode;responseHeaders;requestId;networkRequest;constructor(e,t,n,r,s,i,a){this.#K=e,this.#pe=!1,this.request=t,this.resourceType=n,this.responseStatusCode=i,this.responseHeaders=a,this.requestId=r,this.networkRequest=s}hasResponded(){return this.#pe}static mergeSetCookieHeaders(e,t){const n=e=>{const t=new Map;for(const n of e){const e=n.value.match(/^([a-zA-Z0-9!#$%&'*+.^_`|~-]+=)(.*)$/);e?t.has(e[1])?t.get(e[1])?.push(n.value):t.set(e[1],[n.value]):t.has(n.value)?t.get(n.value)?.push(n.value):t.set(n.value,[n.value])}return t},r=n(e),s=n(t),i=[];for(const[e,t]of r)if(s.has(e))for(const t of s.get(e)||[])i.push({name:"set-cookie",value:t});else for(const e of t)i.push({name:"set-cookie",value:e});for(const[e,t]of s)if(!r.has(e))for(const e of t)i.push({name:"set-cookie",value:e});return i}async continueRequestWithContent(e,t,n,r){this.#pe=!0;const s=t?await e.text():await async function(e){const t=new FileReader,n=new Promise((e=>{t.onloadend=e}));if(t.readAsDataURL(e),await n,t.error)return console.error("Could not convert blob to base64.",t.error),"";const r=t.result;if(null==r||"string"!=typeof r)return console.error("Could not convert blob to base64."),"";return r.substring(r.indexOf(",")+1)}(e),i=r?200:this.responseStatusCode||200;if(this.networkRequest){const e=this.networkRequest?.originalResponseHeaders.filter((e=>"set-cookie"===e.name))||[],t=n.filter((e=>"set-cookie"===e.name));this.networkRequest.setCookieHeaders=ge.mergeSetCookieHeaders(e,t)}this.#K.invoke_fulfillRequest({requestId:this.requestId,responseCode:i,body:s,responseHeaders:n}),ue.instance().dispatchEventToListeners(ue.Events.RequestFulfilled,this.request.url)}continueRequestWithoutChange(){console.assert(!this.#pe),this.#pe=!0,this.#K.invoke_continueRequest({requestId:this.requestId})}continueRequestWithError(e){console.assert(!this.#pe),this.#pe=!0,this.#K.invoke_failRequest({requestId:this.requestId,errorReason:e})}async responseBody(){const e=await this.#K.invoke_getResponseBody({requestId:this.requestId}),t=e.getError()||null;return{error:t,content:t?null:e.body,encoded:e.base64Encoded}}isRedirect(){return void 0!==this.responseStatusCode&&this.responseStatusCode>=300&&this.responseStatusCode<400}}class pe{#me;#fe;#be;#ye;#ve;#Ie;constructor(){this.#me=[],this.#fe=[],this.#be=[],this.#ye=!1,this.#ve=null,this.#Ie=null}addRequest(e){this.#me.push(e),this.sync(this.#me.length-1)}addRequestExtraInfo(e){this.#fe.push(e),this.sync(this.#fe.length-1)}addResponseExtraInfo(e){this.#be.push(e),this.sync(this.#be.length-1)}setWebBundleInfo(e){this.#ve=e,this.updateFinalRequest()}setWebBundleInnerRequestInfo(e){this.#Ie=e,this.updateFinalRequest()}finished(){this.#ye=!0,this.updateFinalRequest()}isFinished(){return this.#ye}sync(e){const t=this.#me[e];if(!t)return;const n=this.#fe[e];n&&(t.addExtraRequestInfo(n),this.#fe[e]=null);const r=this.#be[e];r&&(t.addExtraResponseInfo(r),this.#be[e]=null)}finalRequest(){return this.#ye&&this.#me[this.#me.length-1]||null}updateFinalRequest(){if(!this.#ye)return;const e=this.finalRequest();e?.setWebBundleInfo(this.#ve),e?.setWebBundleInnerRequestInfo(this.#Ie)}}c.register(ne,{capabilities:z.Network,autostart:!0});var me=Object.freeze({__proto__:null,NetworkManager:ne,get Events(){return re},NoThrottlingConditions:se,OfflineConditions:ie,Slow3GConditions:ae,Fast3GConditions:oe,FetchDispatcher:de,NetworkDispatcher:ce,get MultitargetNetworkManager(){return ue},InterceptedRequest:ge,ConditionsSerializer:class{stringify(e){const t=e;return JSON.stringify({...t,title:"function"==typeof t.title?t.title():t.title})}parse(e){const t=JSON.parse(e);return{...t,title:t.i18nTitleKey?Z(t.i18nTitleKey):t.title}}},networkConditionsEqual:function(e,t){const n="function"==typeof e.title?e.title():e.title,r="function"==typeof t.title?t.title():t.title;return t.download===e.download&&t.upload===e.upload&&t.latency===e.latency&&r===n}});const fe={deprecatedSyntaxFoundPleaseUse:"Deprecated syntax found. Please use: <name>;dur=<duration>;desc=<description>",duplicateParameterSIgnored:'Duplicate parameter "{PH1}" ignored.',noValueFoundForParameterS:'No value found for parameter "{PH1}".',unrecognizedParameterS:'Unrecognized parameter "{PH1}".',extraneousTrailingCharacters:"Extraneous trailing characters.",unableToParseSValueS:'Unable to parse "{PH1}" value "{PH2}".'},be=s.i18n.registerUIStrings("core/sdk/ServerTiming.ts",fe),ye=s.i18n.getLocalizedString.bind(void 0,be);class ve{metric;value;description;constructor(e,t,n){this.metric=e,this.value=t,this.description=n}static parseHeaders(e){const n=e.filter((e=>"server-timing"===e.name.toLowerCase()));if(!n.length)return null;const r=n.reduce(((e,t)=>{const n=this.createFromHeaderValue(t.value);return e.push(...n.map((function(e){return new ve(e.name,e.hasOwnProperty("dur")?e.dur:null,e.hasOwnProperty("desc")?e.desc:"")}))),e}),[]);return r.sort(((e,n)=>t.StringUtilities.compare(e.metric.toLowerCase(),n.metric.toLowerCase()))),r}static createFromHeaderValue(e){function t(){e=e.replace(/^\s*/,"")}function n(n){return console.assert(1===n.length),t(),e.charAt(0)===n&&(e=e.substring(1),!0)}function r(){const t=/^(?:\s*)([\w!#$%&'*+\-.^`|~]+)(?:\s*)(.*)/.exec(e);return t?(e=t[2],t[1]):null}function s(){return t(),'"'===e.charAt(0)?function(){console.assert('"'===e.charAt(0)),e=e.substring(1);let t="";for(;e.length;){const n=/^([^"\\]*)(.*)/.exec(e);if(!n)return null;if(t+=n[1],'"'===n[2].charAt(0))return e=n[2].substring(1),t;console.assert("\\"===n[2].charAt(0)),t+=n[2].charAt(1),e=n[2].substring(2)}return null}():r()}function i(){const t=/([,;].*)/.exec(e);t&&(e=t[1])}const a=[];let o;for(;null!==(o=r());){const t={name:o};for("="===e.charAt(0)&&this.showWarning(ye(fe.deprecatedSyntaxFoundPleaseUse));n(";");){let e;if(null===(e=r()))continue;e=e.toLowerCase();const a=this.getParserForParameter(e);let o=null;if(n("=")&&(o=s(),i()),a){if(t.hasOwnProperty(e)){this.showWarning(ye(fe.duplicateParameterSIgnored,{PH1:e}));continue}null===o&&this.showWarning(ye(fe.noValueFoundForParameterS,{PH1:e})),a.call(this,t,o)}else this.showWarning(ye(fe.unrecognizedParameterS,{PH1:e}))}if(a.push(t),!n(","))break}return e.length&&this.showWarning(ye(fe.extraneousTrailingCharacters)),a}static getParserForParameter(e){switch(e){case"dur":{function t(t,n){if(t.dur=0,null!==n){const r=parseFloat(n);if(isNaN(r))return void ve.showWarning(ye(fe.unableToParseSValueS,{PH1:e,PH2:n}));t.dur=r}}return t}case"desc":{function e(e,t){e.desc=t||""}return e}default:return null}}static showWarning(t){e.Console.Console.instance().warn(`ServerTiming: ${t}`)}}var Ie=Object.freeze({__proto__:null,ServerTiming:ve});const ke={binary:"(binary)",secureOnly:'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure.',notOnPath:"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path.",domainMismatch:"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value.",sameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites.',sameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation.',sameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored and was defaulted to "SameSite=Lax," and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',sameSiteNoneInsecure:'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "Secure". Cookies without SameSite restrictions must be marked "Secure" and sent over a secure connection.',userPreferences:"This cookie was blocked due to user preferences.",unknownError:"An unknown error was encountered when trying to send this cookie.",schemefulSameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',samePartyFromCrossPartyContext:"This cookie was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",nameValuePairExceedsMaxSize:"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters.",thisSetcookieWasBlockedDueToUser:"This attempt to set a cookie via a `Set-Cookie` header was blocked due to user preferences.",thisSetcookieHadInvalidSyntax:"This `Set-Cookie` header had invalid syntax.",theSchemeOfThisConnectionIsNot:"The scheme of this connection is not allowed to store cookies.",anUnknownErrorWasEncounteredWhenTrying:"An unknown error was encountered when trying to store this cookie.",thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieDidntSpecifyASamesite:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieWasBlockedBecauseItHadTheSameparty:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',blockedReasonSecureOnly:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "Secure" attribute but was not received over a secure connection.',blockedReasonSameSiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation.',blockedReasonSameSiteUnspecifiedTreatedAsLax:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax,`" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The `Set-Cookie` had to have been set with "`SameSite=None`" to enable cross-site usage.',blockedReasonSameSiteNoneInsecure:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameSite=None`" attribute but did not have the "Secure" attribute, which is required in order to use "`SameSite=None`".',blockedReasonOverwriteSecure:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.",blockedReasonInvalidDomain:"This attempt to set a cookie via a `Set-Cookie` header was blocked because its Domain attribute was invalid with regards to the current host url.",blockedReasonInvalidPrefix:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize:"This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.",setcookieHeaderIsIgnoredIn:"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters."},Se=s.i18n.registerUIStrings("core/sdk/NetworkRequest.ts",ke),we=s.i18n.getLocalizedString.bind(void 0,Se);var Ce,Te,Re,xe;!function(e){e.HTML="text/html",e.XML="text/xml",e.PLAIN="text/plain",e.XHTML="application/xhtml+xml",e.SVG="image/svg+xml",e.CSS="text/css",e.XSL="text/xsl",e.VTT="text/vtt",e.PDF="application/pdf",e.EVENTSTREAM="text/event-stream"}(Ce||(Ce={}));class Me extends e.ObjectWrapper.ObjectWrapper{#ke;#Se;#we;#Ce;#Te;#Re;#xe;#Me;#Pe;#Le;#Ee;#Ae;#Oe;#Ne;#Fe;#Be;#De;statusCode;statusText;requestMethod;requestTime;protocol;alternateProtocolUsage;mixedContentType;#Ue;#He;#qe;#_e;#ze;#je;#We;#Ve;#Ge;#Ke;#$e;#Qe;#Xe;#Je;#Ye;#Ze;#et;#tt;#nt;#rt;#st;connectionId;connectionReused;hasNetworkData;#it;#at;#ot;#lt;#dt;#ct;#ht;#ut;#gt;#pt;localizedFailDescription;#mt;#ft;#bt;#ye;#yt;#vt;#It;#kt;#St;#u;#wt;#Ct;#Tt;#Rt;#xt;#Mt;#Pt;#Lt;#Et;#At;#Ot;#Nt;#Ft;#Bt;#Dt;#Ut;#Ht;#qt;#_t;#zt;#jt;#Wt;#Vt;#Gt;#Kt=new Map;constructor(t,n,r,s,i,a,o,l){super(),this.#ke=t,this.#Se=n,this.setUrl(r),this.#we=s,this.#Ce=i,this.#Te=a,this.#Re=o,this.#xe=l,this.#Me=null,this.#Pe=null,this.#Le=null,this.#Ee=!1,this.#Ae=null,this.#Oe=-1,this.#Ne=-1,this.#Fe=-1,this.#Be=void 0,this.#De=void 0,this.statusCode=0,this.statusText="",this.requestMethod="",this.requestTime=0,this.protocol="",this.alternateProtocolUsage=void 0,this.mixedContentType="none",this.#Ue=null,this.#He=null,this.#qe=null,this.#_e=null,this.#ze=null,this.#je=e.ResourceType.resourceTypes.Other,this.#We=null,this.#Ve=[],this.#Ge=[],this.#Ke={},this.#$e="",this.#Qe=[],this.#Je=[],this.#Ye=[],this.#Ze={},this.#et="",this.#tt="Unknown",this.#nt=null,this.#rt="unknown",this.#st=null,this.connectionId="0",this.connectionReused=!1,this.hasNetworkData=!1,this.#it=null,this.#at=Promise.resolve(null),this.#ot=!1,this.#lt=!1,this.#dt=[],this.#ct=[],this.#ht=[],this.#pt=!1,this.#ut=null,this.#gt=null,this.localizedFailDescription=null,this.#Vt=null,this.#Gt=!1}static create(e,t,n,r,s,i,a){return new Me(e,e,t,n,r,s,i,a)}static createForWebSocket(e,n,r){return new Me(e,e,n,t.DevToolsPath.EmptyUrlString,null,null,r||null)}static createWithoutBackendRequest(e,t,n,r){return new Me(e,void 0,t,n,null,null,r)}identityCompare(e){const t=this.requestId(),n=e.requestId();return t>n?1:t<n?-1:0}requestId(){return this.#ke}backendRequestId(){return this.#Se}url(){return this.#mt}isBlobRequest(){return this.#mt.startsWith("blob:")}setUrl(t){this.#mt!==t&&(this.#mt=t,this.#St=new e.ParsedURL.ParsedURL(t),this.#zt=void 0,this.#jt=void 0,this.#u=void 0,this.#wt=void 0)}get documentURL(){return this.#we}get parsedURL(){return this.#St}get frameId(){return this.#Ce}get loaderId(){return this.#Te}setRemoteAddress(e,t){this.#et=e+":"+t,this.dispatchEventToListeners(Te.RemoteAddressChanged,this)}remoteAddress(){return this.#et}remoteAddressSpace(){return this.#tt}getResponseCacheStorageCacheName(){return this.#xt}setResponseCacheStorageCacheName(e){this.#xt=e}serviceWorkerResponseSource(){return this.#Mt}setServiceWorkerResponseSource(e){this.#Mt=e}setReferrerPolicy(e){this.#nt=e}referrerPolicy(){return this.#nt}securityState(){return this.#rt}setSecurityState(e){this.#rt=e}securityDetails(){return this.#st}securityOrigin(){return this.#St.securityOrigin()}setSecurityDetails(e){this.#st=e}get startTime(){return this.#Ne||-1}setIssueTime(e,t){this.#Oe=e,this.#Pt=t,this.#Ne=e}issueTime(){return this.#Oe}pseudoWallTime(e){return this.#Pt?this.#Pt-this.#Oe+e:e}get responseReceivedTime(){return this.#ft||-1}set responseReceivedTime(e){this.#ft=e}getResponseRetrievalTime(){return this.#Lt}setResponseRetrievalTime(e){this.#Lt=e}get endTime(){return this.#Fe||-1}set endTime(e){this.timing&&this.timing.requestTime?this.#Fe=Math.max(e,this.responseReceivedTime):(this.#Fe=e,this.#ft>e&&(this.#ft=e)),this.dispatchEventToListeners(Te.TimingChanged,this)}get duration(){return-1===this.#Fe||-1===this.#Ne?-1:this.#Fe-this.#Ne}get latency(){return-1===this.#ft||-1===this.#Ne?-1:this.#ft-this.#Ne}get resourceSize(){return this.#Et||0}set resourceSize(e){this.#Et=e}get transferSize(){return this.#bt||0}increaseTransferSize(e){this.#bt=(this.#bt||0)+e}setTransferSize(e){this.#bt=e}get finished(){return this.#ye}set finished(e){this.#ye!==e&&(this.#ye=e,e&&this.dispatchEventToListeners(Te.FinishedLoading,this))}get failed(){return this.#yt}set failed(e){this.#yt=e}get canceled(){return this.#vt}set canceled(e){this.#vt=e}get preserved(){return this.#It}set preserved(e){this.#It=e}blockedReason(){return this.#Be}setBlockedReason(e){this.#Be=e}corsErrorStatus(){return this.#De}setCorsErrorStatus(e){this.#De=e}wasBlocked(){return Boolean(this.#Be)}cached(){return(Boolean(this.#At)||Boolean(this.#Ot))&&!this.#bt}cachedInMemory(){return Boolean(this.#At)&&!this.#bt}fromPrefetchCache(){return Boolean(this.#Nt)}setFromMemoryCache(){this.#At=!0,this.#Bt=void 0}get fromDiskCache(){return this.#Ot}setFromDiskCache(){this.#Ot=!0}setFromPrefetchCache(){this.#Nt=!0}get fetchedViaServiceWorker(){return Boolean(this.#Ft)}set fetchedViaServiceWorker(e){this.#Ft=e}initiatedByServiceWorker(){const e=ne.forRequest(this);return!!e&&e.target().type()===_.ServiceWorker}get timing(){return this.#Bt}set timing(e){if(!e||this.#At)return;this.#Ne=e.requestTime;const t=e.requestTime+e.receiveHeadersEnd/1e3;((this.#ft||-1)<0||this.#ft>t)&&(this.#ft=t),this.#Ne>this.#ft&&(this.#ft=this.#Ne),this.#Bt=e,this.dispatchEventToListeners(Te.TimingChanged,this)}setConnectTimingFromExtraInfo(e){this.#Ne=e.requestTime,this.dispatchEventToListeners(Te.TimingChanged,this)}get mimeType(){return this.#kt}set mimeType(e){this.#kt=e}get displayName(){return this.#St.displayName}name(){return this.#u||this.parseNameAndPathFromURL(),this.#u}path(){return this.#wt||this.parseNameAndPathFromURL(),this.#wt}parseNameAndPathFromURL(){if(this.#St.isDataURL())this.#u=this.#St.dataURLDisplayName(),this.#wt="";else if(this.#St.isBlobURL())this.#u=this.#St.url,this.#wt="";else if(this.#St.isAboutBlank())this.#u=this.#St.url,this.#wt="";else{this.#wt=this.#St.host+this.#St.folderPathComponents;const n=ne.forRequest(this),r=n?e.ParsedURL.ParsedURL.fromString(n.target().inspectedURL()):null;this.#wt=t.StringUtilities.trimURL(this.#wt,r?r.host:""),this.#St.lastPathComponent||this.#St.queryParams?this.#u=this.#St.lastPathComponent+(this.#St.queryParams?"?"+this.#St.queryParams:""):this.#St.folderPathComponents?(this.#u=this.#St.folderPathComponents.substring(this.#St.folderPathComponents.lastIndexOf("/")+1)+"/",this.#wt=this.#wt.substring(0,this.#wt.lastIndexOf("/"))):(this.#u=this.#St.host,this.#wt="")}}get folder(){let e=this.#St.path;const t=e.indexOf("?");-1!==t&&(e=e.substring(0,t));const n=e.lastIndexOf("/");return-1!==n?e.substring(0,n):""}get pathname(){return this.#St.path}resourceType(){return this.#je}setResourceType(e){this.#je=e}get domain(){return this.#St.host}get scheme(){return this.#St.scheme}redirectSource(){return this.#Me}setRedirectSource(e){this.#Me=e}preflightRequest(){return this.#Pe}setPreflightRequest(e){this.#Pe=e}preflightInitiatorRequest(){return this.#Le}setPreflightInitiatorRequest(e){this.#Le=e}isPreflightRequest(){return null!==this.#Re&&void 0!==this.#Re&&"preflight"===this.#Re.type}redirectDestination(){return this.#Ae}setRedirectDestination(e){this.#Ae=e}requestHeaders(){return this.#Ye}setRequestHeaders(e){this.#Ye=e,this.dispatchEventToListeners(Te.RequestHeadersChanged)}requestHeadersText(){return this.#Dt}setRequestHeadersText(e){this.#Dt=e,this.dispatchEventToListeners(Te.RequestHeadersChanged)}requestHeaderValue(e){return this.#Ze[e]||(this.#Ze[e]=this.computeHeaderValue(this.requestHeaders(),e)),this.#Ze[e]}requestFormData(){return this.#at||(this.#at=ne.requestPostData(this)),this.#at}setRequestFormData(e,t){this.#at=e&&null===t?null:Promise.resolve(t),this.#it=null}filteredProtocolName(){const e=this.protocol.toLowerCase();return"h2"===e?"http/2.0":e.replace(/^http\/2(\.0)?\+/,"http/2.0+")}requestHttpVersion(){const e=this.requestHeadersText();if(!e){const e=this.requestHeaderValue("version")||this.requestHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/(HTTP\/\d+\.\d+)$/);return t?t[1]:"HTTP/0.9"}get responseHeaders(){return this.#Ut||[]}set responseHeaders(e){this.#Ut=e,this.#Ht=void 0,this.#_t=void 0,this.#qt=void 0,this.#Ke={},this.dispatchEventToListeners(Te.ResponseHeadersChanged)}get originalResponseHeaders(){return this.#Qe}set originalResponseHeaders(e){this.#Qe=e,this.#Xe=void 0}get setCookieHeaders(){return this.#Je}set setCookieHeaders(e){this.#Je=e}get responseHeadersText(){return this.#$e}set responseHeadersText(e){this.#$e=e,this.dispatchEventToListeners(Te.ResponseHeadersChanged)}get sortedResponseHeaders(){return void 0!==this.#Ht?this.#Ht:(this.#Ht=this.responseHeaders.slice(),this.#Ht.sort((function(e,n){return t.StringUtilities.compare(e.name.toLowerCase(),n.name.toLowerCase())||t.StringUtilities.compare(e.value,n.value)})))}get sortedOriginalResponseHeaders(){return void 0!==this.#Xe?this.#Xe:(this.#Xe=this.originalResponseHeaders.slice(),this.#Xe.sort((function(e,n){return t.StringUtilities.compare(e.name.toLowerCase(),n.name.toLowerCase())||t.StringUtilities.compare(e.value,n.value)})))}hasOverriddenHeaders(){if(!this.#Qe.length)return!1;const e=this.sortedResponseHeaders,t=this.sortedOriginalResponseHeaders;if(t.length!==e.length)return!0;for(let n=0;n<e.length;n++){if(e[n].name.toLowerCase()!==t[n].name.toLowerCase())return!0;if(e[n].value!==t[n].value)return!0}return!1}responseHeaderValue(e){return e in this.#Ke||(this.#Ke[e]=this.computeHeaderValue(this.responseHeaders,e)),this.#Ke[e]}wasIntercepted(){return this.#Gt}setWasIntercepted(e){this.#Gt=e}get responseCookies(){if(!this.#qt)if(this.#qt=H.parseSetCookie(this.responseHeaderValue("Set-Cookie"),this.domain)||[],this.#ut)for(const e of this.#qt)e.setPartitionKey(this.#ut);else if(this.#gt)for(const e of this.#qt)e.setPartitionKeyOpaque();return this.#qt}responseLastModified(){return this.responseHeaderValue("last-modified")}allCookiesIncludingBlockedOnes(){return[...this.includedRequestCookies(),...this.responseCookies,...this.blockedRequestCookies().map((e=>e.cookie)),...this.blockedResponseCookies().map((e=>e.cookie))].filter((e=>Boolean(e)))}get serverTimings(){return void 0===this.#_t&&(this.#_t=ve.parseHeaders(this.responseHeaders)),this.#_t}queryString(){if(void 0!==this.#zt)return this.#zt;let e=null;const t=this.url(),n=t.indexOf("?");if(-1!==n){e=t.substring(n+1);const r=e.indexOf("#");-1!==r&&(e=e.substring(0,r))}return this.#zt=e,this.#zt}get queryParameters(){if(this.#jt)return this.#jt;const e=this.queryString();return e?(this.#jt=this.parseParameters(e),this.#jt):null}async parseFormParameters(){const e=this.requestContentType();if(!e)return null;if(e.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)){const e=await this.requestFormData();return e?this.parseParameters(e):null}const t=e.match(/^multipart\/form-data\s*;\s*boundary\s*=\s*(\S+)\s*$/);if(!t)return null;const n=t[1];if(!n)return null;const r=await this.requestFormData();return r?this.parseMultipartFormDataParameters(r,n):null}formParameters(){return this.#it||(this.#it=this.parseFormParameters()),this.#it}responseHttpVersion(){const e=this.#$e;if(!e){const e=this.responseHeaderValue("version")||this.responseHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/^(HTTP\/\d+\.\d+)/);return t?t[1]:"HTTP/0.9"}parseParameters(e){return e.split("&").map((function(e){const t=e.indexOf("=");return-1===t?{name:e,value:""}:{name:e.substring(0,t),value:e.substring(t+1)}}))}parseMultipartFormDataParameters(e,n){const r=t.StringUtilities.escapeForRegExp(n),s=new RegExp('^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?\\r\\n\\r\\n(.*)\\r\\n$',"is");return e.split(new RegExp(`--${r}(?:--s*$)?`,"g")).reduce((function(e,t){const[n,r,i,a,o]=t.match(s)||[];if(!n)return e;const l=i||a?we(ke.binary):o;return e.push({name:r,value:l}),e}),[])}computeHeaderValue(e,t){t=t.toLowerCase();const n=[];for(let r=0;r<e.length;++r)e[r].name.toLowerCase()===t&&n.push(e[r].value);if(n.length)return"set-cookie"===t?n.join("\n"):n.join(", ")}contentData(){return this.#We||(this.#Wt?this.#We=this.#Wt():this.#We=ne.requestContentData(this)),this.#We}setContentDataProvider(e){console.assert(!this.#We,"contentData can only be set once."),this.#Wt=e}contentURL(){return this.#mt}contentType(){return this.#je}async requestContent(){const{content:e,error:t,encoded:n}=await this.contentData();return{content:e,error:t,isEncoded:n}}async searchInContent(e,t,n){if(!this.#Wt)return ne.searchInRequest(this,e,t,n);const s=await this.contentData();let i=s.content;return i?(s.encoded&&(i=window.atob(i)),r.TextUtils.performSearchInContent(i,e,t,n)):[]}isHttpFamily(){return Boolean(this.url().match(/^https?:/i))}requestContentType(){return this.requestHeaderValue("Content-Type")}hasErrorStatusCode(){return this.statusCode>=400}setInitialPriority(e){this.#Ue=e}initialPriority(){return this.#Ue}setPriority(e){this.#He=e}priority(){return this.#He||this.#Ue||null}setSignedExchangeInfo(e){this.#qe=e}signedExchangeInfo(){return this.#qe}setWebBundleInfo(e){this.#_e=e}webBundleInfo(){return this.#_e}setWebBundleInnerRequestInfo(e){this.#ze=e}webBundleInnerRequestInfo(){return this.#ze}async populateImageSource(e){const{content:t,encoded:n}=await this.contentData();let s=r.ContentProvider.contentAsDataURL(t,this.#kt,n);if(null===s&&!this.#yt){(this.responseHeaderValue("cache-control")||"").includes("no-cache")||(s=this.#mt)}null!==s&&(e.src=s)}initiator(){return this.#Re||null}hasUserGesture(){return this.#xe??null}frames(){return this.#Ve}addProtocolFrameError(e,t){this.addFrame({type:xe.Error,text:e,time:this.pseudoWallTime(t),opCode:-1,mask:!1})}addProtocolFrame(e,t,n){const r=n?xe.Send:xe.Receive;this.addFrame({type:r,text:e.payloadData,time:this.pseudoWallTime(t),opCode:e.opcode,mask:e.mask})}addFrame(e){this.#Ve.push(e),this.dispatchEventToListeners(Te.WebsocketFrameAdded,e)}eventSourceMessages(){return this.#Ge}addEventSourceMessage(e,t,n,r){const s={time:this.pseudoWallTime(e),eventName:t,eventId:n,data:r};this.#Ge.push(s),this.dispatchEventToListeners(Te.EventSourceMessageAdded,s)}markAsRedirect(e){this.#Ee=!0,this.#ke=`${this.#Se}:redirected.${e}`}isRedirect(){return this.#Ee}setRequestIdForTest(e){this.#Se=e,this.#ke=e}charset(){const e=this.responseHeaderValue("content-type");if(!e)return null;const t=e.replace(/ /g,"").split(";").filter((e=>e.toLowerCase().startsWith("charset="))).map((e=>e.slice("charset=".length)));return t.length?t[0]:null}addExtraRequestInfo(e){this.#dt=e.blockedRequestCookies,this.#ct=e.includedRequestCookies,this.setRequestHeaders(e.requestHeaders),this.#ot=!0,this.setRequestHeadersText(""),this.#Ct=e.clientSecurityState,this.setConnectTimingFromExtraInfo(e.connectTiming),this.#pt=e.siteHasCookieInOtherPartition??!1}hasExtraRequestInfo(){return this.#ot}blockedRequestCookies(){return this.#dt}includedRequestCookies(){return this.#ct}hasRequestCookies(){return this.#ct.length>0||this.#dt.length>0}siteHasCookieInOtherPartition(){return this.#pt}static parseStatusTextFromResponseHeadersText(e){return e.split("\r")[0].split(" ").slice(2).join(" ")}addExtraResponseInfo(e){if(this.#ht=e.blockedResponseCookies,this.#ut=e.cookiePartitionKey||null,this.#gt=e.cookiePartitionKeyOpaque||null,this.responseHeaders=e.responseHeaders,this.originalResponseHeaders=e.responseHeaders.map((e=>({...e}))),e.responseHeadersText){if(this.responseHeadersText=e.responseHeadersText,!this.requestHeadersText()){let e=`${this.requestMethod} ${this.parsedURL.path}`;this.parsedURL.queryParams&&(e+=`?${this.parsedURL.queryParams}`),e+=" HTTP/1.1\r\n";for(const{name:t,value:n}of this.requestHeaders())e+=`${t}: ${n}\r\n`;this.setRequestHeadersText(e)}this.statusText=Me.parseStatusTextFromResponseHeadersText(e.responseHeadersText)}this.#tt=e.resourceIPAddressSpace,e.statusCode&&(this.statusCode=e.statusCode),this.#lt=!0;const t=ne.forRequest(this);if(t)for(const e of this.#ht)if(e.blockedReasons.includes("NameValuePairExceedsMaxSize")){const e=we(ke.setcookieHeaderIsIgnoredIn,{PH1:this.url()});t.dispatchEventToListeners(re.MessageGenerated,{message:e,requestId:this.#ke,warning:!0})}}hasExtraResponseInfo(){return this.#lt}blockedResponseCookies(){return this.#ht}responseCookiesPartitionKey(){return this.#ut}responseCookiesPartitionKeyOpaque(){return this.#gt}redirectSourceSignedExchangeInfoHasNoErrors(){return null!==this.#Me&&null!==this.#Me.#qe&&!this.#Me.#qe.errors}clientSecurityState(){return this.#Ct}setTrustTokenParams(e){this.#Tt=e}trustTokenParams(){return this.#Tt}setTrustTokenOperationDoneEvent(e){this.#Rt=e,this.dispatchEventToListeners(Te.TrustTokenResultAdded)}trustTokenOperationDoneEvent(){return this.#Rt}setIsSameSite(e){this.#Vt=e}isSameSite(){return this.#Vt}getAssociatedData(e){return this.#Kt.get(e)||null}setAssociatedData(e,t){this.#Kt.set(e,t)}deleteAssociatedData(e){this.#Kt.delete(e)}}!function(e){e.FinishedLoading="FinishedLoading",e.TimingChanged="TimingChanged",e.RemoteAddressChanged="RemoteAddressChanged",e.RequestHeadersChanged="RequestHeadersChanged",e.ResponseHeadersChanged="ResponseHeadersChanged",e.WebsocketFrameAdded="WebsocketFrameAdded",e.EventSourceMessageAdded="EventSourceMessageAdded",e.TrustTokenResultAdded="TrustTokenResultAdded"}(Te||(Te={})),function(e){e.Other="other",e.Parser="parser",e.Redirect="redirect",e.Script="script",e.Preload="preload",e.SignedExchange="signedExchange",e.Preflight="preflight"}(Re||(Re={})),function(e){e.Send="send",e.Receive="receive",e.Error="error"}(xe||(xe={}));var Pe=Object.freeze({__proto__:null,get MIME_TYPE(){return Ce},NetworkRequest:Me,get Events(){return Te},get InitiatorType(){return Re},get WebSocketFrameType(){return xe},cookieBlockedReasonToUiString:function(e){switch(e){case"SecureOnly":return we(ke.secureOnly);case"NotOnPath":return we(ke.notOnPath);case"DomainMismatch":return we(ke.domainMismatch);case"SameSiteStrict":return we(ke.sameSiteStrict);case"SameSiteLax":return we(ke.sameSiteLax);case"SameSiteUnspecifiedTreatedAsLax":return we(ke.sameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return we(ke.sameSiteNoneInsecure);case"UserPreferences":return we(ke.userPreferences);case"UnknownError":return we(ke.unknownError);case"SchemefulSameSiteStrict":return we(ke.schemefulSameSiteStrict);case"SchemefulSameSiteLax":return we(ke.schemefulSameSiteLax);case"SchemefulSameSiteUnspecifiedTreatedAsLax":return we(ke.schemefulSameSiteUnspecifiedTreatedAsLax);case"SamePartyFromCrossPartyContext":return we(ke.samePartyFromCrossPartyContext);case"NameValuePairExceedsMaxSize":return we(ke.nameValuePairExceedsMaxSize)}return""},setCookieBlockedReasonToUiString:function(e){switch(e){case"SecureOnly":return we(ke.blockedReasonSecureOnly);case"SameSiteStrict":return we(ke.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Strict"});case"SameSiteLax":return we(ke.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Lax"});case"SameSiteUnspecifiedTreatedAsLax":return we(ke.blockedReasonSameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return we(ke.blockedReasonSameSiteNoneInsecure);case"UserPreferences":return we(ke.thisSetcookieWasBlockedDueToUser);case"SyntaxError":return we(ke.thisSetcookieHadInvalidSyntax);case"SchemeNotSupported":return we(ke.theSchemeOfThisConnectionIsNot);case"OverwriteSecure":return we(ke.blockedReasonOverwriteSecure);case"InvalidDomain":return we(ke.blockedReasonInvalidDomain);case"InvalidPrefix":return we(ke.blockedReasonInvalidPrefix);case"UnknownError":return we(ke.anUnknownErrorWasEncounteredWhenTrying);case"SchemefulSameSiteStrict":return we(ke.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Strict"});case"SchemefulSameSiteLax":return we(ke.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Lax"});case"SchemefulSameSiteUnspecifiedTreatedAsLax":return we(ke.thisSetcookieDidntSpecifyASamesite);case"SamePartyFromCrossPartyContext":return we(ke.thisSetcookieWasBlockedBecauseItHadTheSameparty);case"SamePartyConflictsWithOtherAttributes":return we(ke.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute);case"NameValuePairExceedsMaxSize":return we(ke.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize)}return""},cookieBlockedReasonToAttribute:function(e){switch(e){case"SecureOnly":return D.Secure;case"NotOnPath":return D.Path;case"DomainMismatch":return D.Domain;case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return D.SameSite;case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"UnknownError":return null}return null},setCookieBlockedReasonToAttribute:function(e){switch(e){case"SecureOnly":case"OverwriteSecure":return D.Secure;case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return D.SameSite;case"InvalidDomain":return D.Domain;case"InvalidPrefix":return D.Name;case"SamePartyConflictsWithOtherAttributes":case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"SyntaxError":case"SchemeNotSupported":case"UnknownError":return null}return null}});class Le{static fromLocalObject(e){return new Fe(e)}static type(e){if(null===e)return"null";const t=typeof e;return"object"!==t&&"function"!==t?t:e.type}static isNullOrUndefined(e){if(void 0===e)return!0;switch(e.type){case"object":return"null"===e.subtype;case"undefined":return!0;default:return!1}}static arrayNameFromDescription(e){return e.replace(Ue,"").replace(He,"")}static arrayLength(e){if("array"!==e.subtype&&"typedarray"!==e.subtype)return 0;const t=e.description&&e.description.match(Ue),n=e.description&&e.description.match(He);return t?parseInt(t[1],10):n?parseInt(n[1],10):0}static arrayBufferByteLength(e){if("arraybuffer"!==e.subtype)return 0;const t=e.description&&e.description.match(Ue);return t?parseInt(t[1],10):0}static unserializableDescription(e){const t=typeof e;if("number"===t){const t=String(e);if(0===e&&1/e<0)return"-0";if("NaN"===t||"Infinity"===t||"-Infinity"===t)return t}return"bigint"===t?e+"n":null}static toCallArgument(e){const t=typeof e;if("undefined"===t)return{};const n=Le.unserializableDescription(e);if("number"===t)return null!==n?{unserializableValue:n}:{value:e};if("bigint"===t)return{unserializableValue:n};if("string"===t||"boolean"===t)return{value:e};if(!e)return{value:null};const r=e;if(e instanceof Le){const t=e.unserializableValue();if(void 0!==t)return{unserializableValue:t}}else if(void 0!==r.unserializableValue)return{unserializableValue:r.unserializableValue};return void 0!==r.objectId?{objectId:r.objectId}:{value:r.value}}static async loadFromObjectPerProto(e,t,n=!1){const r=await Promise.all([e.getAllProperties(!0,t,n),e.getOwnProperties(t,n)]),s=r[0].properties,i=r[1].properties,a=r[1].internalProperties;if(!i||!s)return{properties:null,internalProperties:null};const o=new Map,l=[];for(let e=0;e<s.length;e++){const t=s[e];t.symbol?l.push(t):(t.isOwn||"__proto__"!==t.name)&&o.set(t.name,t)}for(let e=0;e<i.length;e++){const t=i[e];t.isAccessorProperty()||(t.private||t.symbol?l.push(t):o.set(t.name,t))}return{properties:[...o.values()].concat(l),internalProperties:a||null}}customPreview(){return null}get objectId(){return"Not implemented"}get type(){throw"Not implemented"}get subtype(){throw"Not implemented"}get value(){throw"Not implemented"}unserializableValue(){throw"Not implemented"}get description(){throw"Not implemented"}set description(e){throw"Not implemented"}get hasChildren(){throw"Not implemented"}get preview(){}get className(){return null}arrayLength(){throw"Not implemented"}arrayBufferByteLength(){throw"Not implemented"}getOwnProperties(e,t){throw"Not implemented"}getAllProperties(e,t,n){throw"Not implemented"}async deleteProperty(e){throw"Not implemented"}async setPropertyValue(e,t){throw"Not implemented"}callFunction(e,t){throw"Not implemented"}callFunctionJSON(e,t){throw"Not implemented"}release(){}debuggerModel(){throw new Error("DebuggerModel-less object")}runtimeModel(){throw new Error("RuntimeModel-less object")}isNode(){return!1}webIdl}class Ee extends Le{runtimeModelInternal;#$t;#p;#Qt;#Xt;#Jt;hasChildrenInternal;#Yt;#Zt;#g;#en;#tn;constructor(e,t,n,r,s,i,a,o,l,d){super(),this.runtimeModelInternal=e,this.#$t=e.target().runtimeAgent(),this.#p=n,this.#Qt=r,t?(this.#Xt=t,this.#Jt=a,this.hasChildrenInternal="symbol"!==n,this.#Yt=o):(this.#Jt=a,!this.description&&i&&(this.#Jt=i),this.#Jt||"object"==typeof s&&null!==s||(this.#Jt=String(s)),this.hasChildrenInternal=!1,"string"==typeof i?(this.#Zt=i,"Infinity"===i||"-Infinity"===i||"-0"===i||"NaN"===i?this.#g=Number(i):"bigint"===n&&i.endsWith("n")?this.#g=BigInt(i.substring(0,i.length-1)):this.#g=i):this.#g=s),this.#en=l||null,this.#tn="string"==typeof d?d:null}customPreview(){return this.#en}get objectId(){return this.#Xt}get type(){return this.#p}get subtype(){return this.#Qt}get value(){return this.#g}unserializableValue(){return this.#Zt}get description(){return this.#Jt}set description(e){this.#Jt=e}get hasChildren(){return this.hasChildrenInternal}get preview(){return this.#Yt}get className(){return this.#tn}getOwnProperties(e,t=!1){return this.doGetProperties(!0,!1,t,e)}getAllProperties(e,t,n=!1){return this.doGetProperties(!1,e,n,t)}async createRemoteObject(e){return this.runtimeModelInternal.createRemoteObject(e)}async doGetProperties(e,t,n,r){if(!this.#Xt)return{properties:null,internalProperties:null};const s=await this.#$t.invoke_getProperties({objectId:this.#Xt,ownProperties:e,accessorPropertiesOnly:t,nonIndexedPropertiesOnly:n,generatePreview:r});if(s.getError())return{properties:null,internalProperties:null};if(s.exceptionDetails)return this.runtimeModelInternal.exceptionThrown(Date.now(),s.exceptionDetails),{properties:null,internalProperties:null};const{result:i=[],internalProperties:a=[],privateProperties:o=[]}=s,l=[];for(const e of i){const t=e.value?await this.createRemoteObject(e.value):null,n=e.symbol?this.runtimeModelInternal.createRemoteObject(e.symbol):null,r=new Ne(e.name,t,Boolean(e.enumerable),Boolean(e.writable),Boolean(e.isOwn),Boolean(e.wasThrown),n);void 0===e.value&&(e.get&&"undefined"!==e.get.type&&(r.getter=this.runtimeModelInternal.createRemoteObject(e.get)),e.set&&"undefined"!==e.set.type&&(r.setter=this.runtimeModelInternal.createRemoteObject(e.set))),l.push(r)}for(const e of o){const t=e.value?this.runtimeModelInternal.createRemoteObject(e.value):null,n=new Ne(e.name,t,!0,!0,!0,!1,void 0,!1,void 0,!0);void 0===e.value&&(e.get&&"undefined"!==e.get.type&&(n.getter=this.runtimeModelInternal.createRemoteObject(e.get)),e.set&&"undefined"!==e.set.type&&(n.setter=this.runtimeModelInternal.createRemoteObject(e.set))),l.push(n)}const d=[];for(const e of a){if(!e.value)continue;if("[[StableObjectId]]"===e.name)continue;const t=this.runtimeModelInternal.createRemoteObject(e.value);d.push(new Ne(e.name,t,!0,!1,void 0,void 0,void 0,!0))}return{properties:l,internalProperties:d}}async setPropertyValue(e,t){if(!this.#Xt)return"Can’t set a property of non-object.";const n=await this.#$t.invoke_evaluate({expression:t,silent:!0});if(n.getError()||n.exceptionDetails)return n.getError()||("string"!==n.result.type?n.result.description:n.result.value);"string"==typeof e&&(e=Le.toCallArgument(e));const r=this.doSetObjectPropertyValue(n.result,e);return n.result.objectId&&this.#$t.invoke_releaseObject({objectId:n.result.objectId}),r}async doSetObjectPropertyValue(e,t){const n=[t,Le.toCallArgument(e)],r=await this.#$t.invoke_callFunctionOn({objectId:this.#Xt,functionDeclaration:"function(a, b) { this[a] = b; }",arguments:n,silent:!0}),s=r.getError();return s||r.exceptionDetails?s||r.result.description:void 0}async deleteProperty(e){if(!this.#Xt)return"Can’t delete a property of non-object.";const t=await this.#$t.invoke_callFunctionOn({objectId:this.#Xt,functionDeclaration:"function(a) { delete this[a]; return !(a in this); }",arguments:[e],silent:!0});return t.getError()||t.exceptionDetails?t.getError()||t.result.description:t.result.value?void 0:"Failed to delete property."}async callFunction(e,t){const n=await this.#$t.invoke_callFunctionOn({objectId:this.#Xt,functionDeclaration:e.toString(),arguments:t,silent:!0});return n.getError()?{object:null,wasThrown:!1}:{object:this.runtimeModelInternal.createRemoteObject(n.result),wasThrown:Boolean(n.exceptionDetails)}}async callFunctionJSON(e,t){const n=await this.#$t.invoke_callFunctionOn({objectId:this.#Xt,functionDeclaration:e.toString(),arguments:t,silent:!0,returnByValue:!0});return n.getError()||n.exceptionDetails?null:n.result.value}release(){this.#Xt&&this.#$t.invoke_releaseObject({objectId:this.#Xt})}arrayLength(){return Le.arrayLength(this)}arrayBufferByteLength(){return Le.arrayBufferByteLength(this)}debuggerModel(){return this.runtimeModelInternal.debuggerModel()}runtimeModel(){return this.runtimeModelInternal}isNode(){return Boolean(this.#Xt)&&"object"===this.type&&"node"===this.subtype}}class Ae extends Ee{#nn;#rn;constructor(e,t,n,r,s,i,a,o,l){super(e,t,r,s,i,a,o,l),this.#nn=n,this.#rn=void 0}async doGetProperties(e,t,n){if(t)return{properties:[],internalProperties:[]};if(this.#rn)return{properties:this.#rn.slice(),internalProperties:null};const r=await super.doGetProperties(e,t,!1,!0);if(this.#nn&&Array.isArray(r.properties)&&(this.#rn=r.properties.slice(),!this.#nn.callFrameId))for(const e of this.#rn)e.writable=!1;return r}async doSetObjectPropertyValue(e,t){const n=t.value,r=await this.debuggerModel().setVariableValue(this.#nn.number,n,Le.toCallArgument(e),this.#nn.callFrameId);if(r)return r;if(this.#rn)for(const t of this.#rn)t.name===n&&(t.value=this.runtimeModel().createRemoteObject(e))}}class Oe{number;callFrameId;constructor(e,t){this.number=e,this.callFrameId=t}}class Ne{name;value;enumerable;writable;isOwn;wasThrown;symbol;synthetic;syntheticSetter;private;getter;setter;webIdl;constructor(e,t,n,r,s,i,a,o,l,d){this.name=e,this.value=null!==t?t:void 0,this.enumerable=void 0===n||n;const c=!o||Boolean(l);this.writable=void 0!==r?r:c,this.isOwn=Boolean(s),this.wasThrown=Boolean(i),a&&(this.symbol=a),this.synthetic=Boolean(o),l&&(this.syntheticSetter=l),this.private=Boolean(d)}async setSyntheticValue(e){if(!this.syntheticSetter)return!1;const t=await this.syntheticSetter(e);return t&&(this.value=t),Boolean(t)}isAccessorProperty(){return Boolean(this.getter||this.setter)}match({includeNullOrUndefinedValues:e,regex:t}){return!(null!==t&&!t.test(this.name)&&!t.test(this.value?.description??""))&&!(!e&&!this.isAccessorProperty()&&Le.isNullOrUndefined(this.value))}}class Fe extends Le{valueInternal;#sn;#in;constructor(e){super(),this.valueInternal=e}get objectId(){}get value(){return this.valueInternal}unserializableValue(){return Le.unserializableDescription(this.valueInternal)||void 0}get description(){if(this.#sn)return this.#sn;if("object"===this.type)switch(this.subtype){case"array":this.#sn=this.concatenate("[","]",function(e){return this.formatValue(e.value||null)}.bind(this));break;case"date":this.#sn=String(this.valueInternal);break;case"null":this.#sn="null";break;default:this.#sn=this.concatenate("{","}",function(e){let t=e.name;return/^\s|\s$|^$|\n/.test(t)&&(t='"'+t.replace(/\n/g,"↵")+'"'),t+": "+this.formatValue(e.value||null)}.bind(this))}else this.#sn=String(this.valueInternal);return this.#sn}formatValue(e){if(!e)return"undefined";const t=e.description||"";return"string"===e.type?'"'+t.replace(/\n/g,"↵")+'"':t}concatenate(e,t,n){let r=e;const s=this.children();for(let e=0;e<s.length;++e){const t=n(s[e]);if(r.length+t.length>100){r+=",…";break}e&&(r+=", "),r+=t}return r+=t,r}get type(){return typeof this.valueInternal}get subtype(){return null===this.valueInternal?"null":Array.isArray(this.valueInternal)?"array":this.valueInternal instanceof Date?"date":void 0}get hasChildren(){return"object"==typeof this.valueInternal&&null!==this.valueInternal&&Boolean(Object.keys(this.valueInternal).length)}async getOwnProperties(e,t=!1){let n=this.children();return t&&(n=n.filter((e=>!function(e){const t=Number(e)>>>0;return String(t)===e}(e.name)))),{properties:n,internalProperties:null}}async getAllProperties(e,t,n=!1){return e?{properties:[],internalProperties:null}:await this.getOwnProperties(t,n)}children(){if(!this.hasChildren)return[];const e=this.valueInternal;return this.#in||(this.#in=Object.keys(e).map((function(t){let n=e[t];return n instanceof Le||(n=Le.fromLocalObject(n)),new Ne(t,n)}))),this.#in}arrayLength(){return Array.isArray(this.valueInternal)?this.valueInternal.length:0}async callFunction(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s,i=!1;try{s=e.apply(n,r)}catch(e){i=!0}return{object:Le.fromLocalObject(s),wasThrown:i}}async callFunctionJSON(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s;try{s=e.apply(n,r)}catch(e){s=null}return s}}class Be{#an;constructor(e){this.#an=e}static objectAsArray(e){if(!e||"object"!==e.type||"array"!==e.subtype&&"typedarray"!==e.subtype)throw new Error("Object is empty or not an array");return new Be(e)}static createFromRemoteObjects(e){if(!e.length)throw new Error("Input array is empty");const t=[];for(let n=0;n<e.length;++n)t.push(Le.toCallArgument(e[n]));return e[0].callFunction((function(){if(arguments.length>1)return new Array(arguments);return[arguments[0]]}),t).then((function(e){if(e.wasThrown||!e.object)throw new Error("Call function throws exceptions or returns empty value");return Be.objectAsArray(e.object)}))}at(e){if(e<0||e>this.#an.arrayLength())throw new Error("Out of range");return this.#an.callFunction((function(e){return this[e]}),[Le.toCallArgument(e)]).then((function(e){if(e.wasThrown||!e.object)throw new Error("Exception in callFunction or result value is empty");return e.object}))}length(){return this.#an.arrayLength()}map(e){const t=[];for(let n=0;n<this.length();++n)t.push(this.at(n).then(e));return Promise.all(t)}object(){return this.#an}}class De{#an;constructor(e){this.#an=e}static objectAsFunction(e){if(!e||"function"!==e.type)throw new Error("Object is empty or not a function");return new De(e)}targetFunction(){return this.#an.getOwnProperties(!1).then(function(e){if(!e.internalProperties)return this.#an;const t=e.internalProperties;for(const e of t)if("[[TargetFunction]]"===e.name)return e.value;return this.#an}.bind(this))}targetFunctionDetails(){return this.targetFunction().then(function(t){const n=e.bind(null,this.#an!==t?t:null);return t.debuggerModel().functionDetailsPromise(t).then(n)}.bind(this));function e(e,t){return e&&e.release(),t}}object(){return this.#an}}const Ue=/\(([0-9]+)\)/,He=/\[([0-9]+)\]/;var qe=Object.freeze({__proto__:null,RemoteObject:Le,RemoteObjectImpl:Ee,ScopeRemoteObject:Ae,ScopeRef:Oe,RemoteObjectProperty:Ne,LocalJSONObject:Fe,RemoteArrayBuffer:class{#an;constructor(e){if("object"!==e.type||"arraybuffer"!==e.subtype)throw new Error("Object is not an arraybuffer");this.#an=e}byteLength(){return this.#an.arrayBufferByteLength()}async bytes(e=0,t=this.byteLength()){if(e<0||e>=this.byteLength())throw new RangeError("start is out of range");if(t<e||t>this.byteLength())throw new RangeError("end is out of range");return await this.#an.callFunctionJSON((function(e,t){return[...new Uint8Array(this,e,t)]}),[{value:e},{value:t-e}])}object(){return this.#an}},RemoteArray:Be,RemoteFunction:De});class _e{#on;#ln;#dn;#cn;#hn;constructor(e){this.#on=e.fontFamily,this.#ln=e.fontVariationAxes||[],this.#dn=new Map,this.#cn=e.src,this.#hn=e.fontDisplay;for(const e of this.#ln)this.#dn.set(e.tag,e)}getFontFamily(){return this.#on}getSrc(){return this.#cn}getFontDisplay(){return this.#hn}getVariationAxisByTag(e){return this.#dn.get(e)}}var ze=Object.freeze({__proto__:null,CSSFontFace:_e});class je{text="";range;styleSheetId;cssModel;constructor(e){this.cssModel=e}rebase(e){this.styleSheetId===e.styleSheetId&&this.range&&(e.oldRange.equal(this.range)?this.reinitialize(e.payload):this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}equal(e){return!!(this.styleSheetId&&this.range&&e.range)&&(this.styleSheetId===e.styleSheetId&&this.range.equal(e.range))}lineNumberInSource(){if(this.range)return this.header()?.lineNumberInSource(this.range.startLine)}columnNumberInSource(){if(this.range)return this.header()?.columnNumberInSource(this.range.startLine,this.range.startColumn)}header(){return this.styleSheetId?this.cssModel.styleSheetHeaderForId(this.styleSheetId):null}rawLocation(){const e=this.header();if(!e||void 0===this.lineNumberInSource())return null;const t=Number(this.lineNumberInSource());return new rn(e,t,this.columnNumberInSource())}}var We=Object.freeze({__proto__:null,CSSQuery:je});class Ve extends je{name;physicalAxes;logicalAxes;static parseContainerQueriesPayload(e,t){return t.map((t=>new Ve(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.name=e.name,this.physicalAxes=e.physicalAxes,this.logicalAxes=e.logicalAxes}active(){return!0}async getContainerForNode(e){const t=await this.cssModel.domModel().getContainerForNode(e,this.name,this.physicalAxes,this.logicalAxes);if(t)return new Ge(t)}}class Ge{containerNode;constructor(e){this.containerNode=e}async getContainerSizeDetails(){const e=await this.containerNode.domModel().cssModel().getComputedStyle(this.containerNode.id);if(!e)return;const t=e.get("container-type"),n=e.get("contain"),r=e.get("writing-mode");if(!t||!n||!r)return;const s=Ke(`${t} ${n}`),i=$e(s,r);let a,o;return"Both"!==i&&"Horizontal"!==i||(a=e.get("width")),"Both"!==i&&"Vertical"!==i||(o=e.get("height")),{queryAxis:s,physicalAxis:i,width:a,height:o}}}const Ke=e=>{const t=e.split(" ");let n=!1,r=!1;for(const e of t){if("size"===e)return"size";n=n||"inline-size"===e,r=r||"block-size"===e}return n&&r?"size":n?"inline-size":r?"block-size":""},$e=(e,t)=>{const n=t.startsWith("vertical");switch(e){case"":return"";case"size":return"Both";case"inline-size":return n?"Vertical":"Horizontal";case"block-size":return n?"Horizontal":"Vertical"}};var Qe=Object.freeze({__proto__:null,CSSContainerQuery:Ve,CSSContainerQueryContainer:Ge,getQueryAxis:Ke,getPhysicalAxisFromQueryAxis:$e});class Xe extends je{static parseLayerPayload(e,t){return t.map((t=>new Xe(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Je=Object.freeze({__proto__:null,CSSLayer:Xe});class Ye{#un;#gn;constructor(e){this.#un=e.active,this.#gn=[];for(let t=0;t<e.expressions.length;++t)this.#gn.push(Ze.parsePayload(e.expressions[t]))}static parsePayload(e){return new Ye(e)}active(){return this.#un}expressions(){return this.#gn}}class Ze{#g;#pn;#mn;#fn;#bn;constructor(e){this.#g=e.value,this.#pn=e.unit,this.#mn=e.feature,this.#fn=e.valueRange?r.TextRange.TextRange.fromObject(e.valueRange):null,this.#bn=e.computedLength||null}static parsePayload(e){return new Ze(e)}value(){return this.#g}unit(){return this.#pn}feature(){return this.#mn}valueRange(){return this.#fn}computedLength(){return this.#bn}}class et extends je{source;sourceURL;mediaList;static parseMediaArrayPayload(e,t){return t.map((t=>new et(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){if(this.text=e.text,this.source=e.source,this.sourceURL=e.sourceURL||"",this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.mediaList=null,e.mediaList){this.mediaList=[];for(let t=0;t<e.mediaList.length;++t)this.mediaList.push(Ye.parsePayload(e.mediaList[t]))}}active(){if(!this.mediaList)return!0;for(let e=0;e<this.mediaList.length;++e)if(this.mediaList[e].active())return!0;return!1}}var tt=Object.freeze({__proto__:null,CSSMediaQuery:Ye,CSSMediaQueryExpression:Ze,CSSMedia:et,Source:{LINKED_SHEET:"linkedSheet",INLINE_SHEET:"inlineSheet",MEDIA_RULE:"mediaRule",IMPORT_RULE:"importRule"}});class nt extends je{static parseScopesPayload(e,t){return t.map((t=>new nt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var rt=Object.freeze({__proto__:null,CSSScope:nt});class st extends je{static parseSupportsPayload(e,t){return t.map((t=>new st(e,t)))}#yn=!0;constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.#yn=e.active}active(){return this.#yn}}var it=Object.freeze({__proto__:null,CSSSupports:st});class at{ownerStyle;index;name;value;important;disabled;parsedOk;implicit;text;range;#yn;#vn;#fn;#In;#kn=[];constructor(e,t,n,s,i,a,o,l,d,c,h){if(this.ownerStyle=e,this.index=t,this.name=n,this.value=s,this.important=i,this.disabled=a,this.parsedOk=o,this.implicit=l,this.text=d,this.range=c?r.TextRange.TextRange.fromObject(c):null,this.#yn=!0,this.#vn=null,this.#fn=null,h&&h.length>0)for(const n of h)this.#kn.push(new at(e,++t,n.name,n.value,i,a,o,!0));else{const r=v().getLonghands(n);for(const n of r||[])this.#kn.push(new at(e,++t,n,"",i,a,o,!0))}}static parsePayload(e,t,n){return new at(e,t,n.name,n.value,n.important||!1,n.disabled||!1,!("parsedOk"in n)||Boolean(n.parsedOk),Boolean(n.implicit),n.text,n.range,n.longhandProperties)}ensureRanges(){if(this.#vn&&this.#fn)return;const e=this.range,t=this.text?new r.Text.Text(this.text):null;if(!e||!t)return;const n=t.value().indexOf(this.name),s=t.value().lastIndexOf(this.value);if(-1===n||-1===s||n>s)return;const i=new r.TextRange.SourceRange(n,this.name.length),a=new r.TextRange.SourceRange(s,this.value.length);function o(e,t,n){return 0===e.startLine&&(e.startColumn+=n,e.endColumn+=n),e.startLine+=t,e.endLine+=t,e}this.#vn=o(t.toTextRange(i),e.startLine,e.startColumn),this.#fn=o(t.toTextRange(a),e.startLine,e.startColumn)}nameRange(){return this.ensureRanges(),this.#vn}valueRange(){return this.ensureRanges(),this.#fn}rebase(e){this.ownerStyle.styleSheetId===e.styleSheetId&&this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}setActive(e){this.#yn=e}get propertyText(){return void 0!==this.text?this.text:""===this.name?"":this.name+": "+this.value+(this.important?" !important":"")+";"}activeInStyle(){return this.#yn}trimmedValueWithoutImportant(){const e="!important";return this.value.endsWith(e)?this.value.slice(0,-e.length).trim():this.value.trim()}async setText(n,s,a){if(!this.ownerStyle)throw new Error("No ownerStyle for property");if(!this.ownerStyle.styleSheetId)throw new Error("No owner style id");if(!this.range||!this.ownerStyle.range)throw new Error("Style not editable");if(s&&(i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited),this.name.startsWith("--")&&i.userMetrics.actionTaken(i.UserMetrics.Action.CustomPropertyEdited)),a&&n===this.propertyText)return this.ownerStyle.cssModel().domModel().markUndoableState(!s),!0;const o=this.range.relativeTo(this.ownerStyle.range.startLine,this.ownerStyle.range.startColumn),l=this.ownerStyle.cssText?this.detectIndentation(this.ownerStyle.cssText):e.Settings.Settings.instance().moduleSetting("textEditorIndent").get(),d=this.ownerStyle.cssText?l.substring(0,this.ownerStyle.range.endColumn):"",c=new r.Text.Text(this.ownerStyle.cssText||"").replaceRange(o,t.StringUtilities.sprintf(";%s;",n)),h=await at.formatStyle(c,l,d);return this.ownerStyle.setText(h,s)}static async formatStyle(e,t,n){const s=t.substring(n.length)+t;t&&(t="\n"+t);let i="",a="",o="",l=!1,d=!1;const c=r.CodeMirrorUtils.createCssTokenizer();return await c("*{"+e+"}",(function(e,n){if(!l){const r=n?.includes("comment")&&function(e){const t=e.indexOf(":");if(-1===t)return!1;const n=e.substring(2,t).trim();return v().isCSSPropertyName(n)}(e),s=n?.includes("string")||n?.includes("meta")||n?.includes("property")||n?.includes("variableName")&&"variableName.function"!==n;return r?i=i.trimEnd()+t+e:s?(l=!0,o=e):(";"!==e||d)&&(i+=e,e.trim()&&!n?.includes("comment")&&(d=";"!==e)),void("{"!==e||n||(d=!1))}if("}"===e||";"===e){const n=o.trim();return i=i.trimEnd()+t+n+(n.endsWith(":")?" ":"")+e,d=!1,l=!1,void(a="")}if(v().isGridAreaDefiningProperty(a)){const t=b.exec(e);t&&0===t.index&&!o.trimEnd().endsWith("]")&&(o=o.trimEnd()+"\n"+s)}a||":"!==e||(a=o);o+=e})),l&&(i+=o),i=i.substring(2,i.length-1).trimEnd(),i+(t?"\n"+n:"")}detectIndentation(e){const t=e.split("\n");return t.length<2?"":r.TextUtils.Utils.lineIndent(t[1])}setValue(e,t,n,r){const s=this.name+": "+e+(this.important?" !important":"")+";";this.setText(s,t,n).then(r)}async setDisabled(e){if(!this.ownerStyle)return!1;if(e===this.disabled)return!0;if(!this.text)return!0;const t=this.text.trim(),n=e=>e+(e.endsWith(";")?"":";");let r;return r=e?"/* "+n(t)+" */":n(this.text.substring(2,t.length-2).trim()),this.setText(r,!0,!0)}setDisplayedStringForInvalidProperty(e){this.#In=e}getInvalidStringForInvalidProperty(){return this.#In}getLonghandProperties(){return this.#kn}}var ot,lt=Object.freeze({__proto__:null,CSSProperty:at});class dt{#Sn;parentRule;#wn;styleSheetId;range;cssText;#Cn;#Tn;#Rn;#xn;type;constructor(e,t,n,r){this.#Sn=e,this.parentRule=t,this.#Mn(n),this.type=r}rebase(e){if(this.styleSheetId===e.styleSheetId&&this.range)if(e.oldRange.equal(this.range))this.#Mn(e.payload);else{this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange);for(let t=0;t<this.#wn.length;++t)this.#wn[t].rebase(e)}}#Mn(e){this.styleSheetId=e.styleSheetId,this.range=e.range?r.TextRange.TextRange.fromObject(e.range):null;const t=e.shorthandEntries;this.#Cn=new Map,this.#Tn=new Set;for(let e=0;e<t.length;++e)this.#Cn.set(t[e].name,t[e].value),t[e].important&&this.#Tn.add(t[e].name);if(this.#wn=[],e.cssText&&this.range){const t=new r.Text.Text(e.cssText);let n={line:this.range.startLine,column:this.range.startColumn};const s=[];for(const r of e.cssProperties){const e=r.range;if(!e)continue;this.#Pn(t,n.line,n.column,e.startLine,e.startColumn),n={line:e.endLine,column:e.endColumn};const i=at.parsePayload(this,this.#wn.length,r);this.#wn.push(i);for(const e of i.getLonghandProperties())s.push(e)}for(const e of s)e.index=this.#wn.length,this.#wn.push(e);this.#Pn(t,n.line,n.column,this.range.endLine,this.range.endColumn)}else for(const t of e.cssProperties)this.#wn.push(at.parsePayload(this,this.#wn.length,t));this.#Ln(),this.#En(),this.#Rn=new Map;for(const e of this.#wn)e.activeInStyle()&&this.#Rn.set(e.name,e);this.cssText=e.cssText,this.#xn=null}#Pn(e,t,n,s,i){const a=new r.TextRange.TextRange(t,n,s,i);if(!this.range)return;const o=e.extract(a.relativeTo(this.range.startLine,this.range.startColumn)).split("\n"),l={inComment:!1,nestedBlocks:0,validContent:""};for(let e=0;e<o.length;e++){if(d(o[e],l),l.nestedBlocks>0||!l.validContent)continue;let s=0;for(const i of l.validContent.split(";")){const a=i.trim();if(a){let o,l;const d=a.indexOf(":");-1===d?(o=a,l=""):(o=a.substring(0,d).trim(),l=a.substring(d+1).trim());const c=new r.TextRange.TextRange(e,s,e,s+i.length);this.#wn.push(new at(this,this.#wn.length,o,l,!1,!1,!1,!1,i,c.relativeFrom(t,n)))}s+=i.length+1}}function d(e,t){t.validContent="";for(let n=0;n<e.length;n++)t.inComment?"*/"===e.substring(n,n+2)&&(t.inComment=!1,n++):"{"===e[n]?(t.nestedBlocks++,t.validContent=t.validContent.substring(0,t.validContent.lastIndexOf(";")+1)):"}"===e[n]?t.nestedBlocks--:"/*"===e.substring(n,n+2)?(t.inComment=!0,n++):0===t.nestedBlocks&&(t.validContent+=e[n])}}#Ln(){if(this.range)return;if(!this.#Cn.size)return;const e=new Set;for(const t of this.#wn)e.add(t.name);const t=[];for(const n of this.#wn){const r=v().getShorthands(n.name)||[];for(const n of r){if(e.has(n))continue;const r=this.#Cn.get(n);if(!r)continue;const s=Boolean(this.#Tn.has(n)),i=new at(this,this.allProperties().length,n,r,s,!1,!0,!1);t.push(i),e.add(n)}}this.#wn=this.#wn.concat(t)}#An(){if(this.range)return this.#wn.filter((function(e){return Boolean(e.range)}));const e=[];for(const t of this.#wn){const n=v().getShorthands(t.name)||[];let r=!1;for(const e of n)if(this.#Cn.get(e)){r=!0;break}r||e.push(t)}return e}leadingProperties(){return this.#xn||(this.#xn=this.#An()),this.#xn}target(){return this.#Sn.target()}cssModel(){return this.#Sn}#En(){const e=new Map,t=new Set;for(const n of this.#wn){if(n.disabled||!n.parsedOk){n.setActive(!1);continue}if(t.has(n))continue;const r=v().canonicalPropertyName(n.name);for(const r of n.getLonghandProperties()){const n=e.get(r.name);n?!n.important||r.important?(n.setActive(!1),e.set(r.name,r)):r.setActive(!1):e.set(r.name,r),t.add(r)}const s=e.get(r);s?!s.important||n.important?(s.setActive(!1),e.set(r,n)):n.setActive(!1):e.set(r,n)}}allProperties(){return this.#wn}hasActiveProperty(e){return this.#Rn.has(e)}getPropertyValue(e){const t=this.#Rn.get(e);return t?t.value:""}isPropertyImplicit(e){const t=this.#Rn.get(e);return!!t&&t.implicit}propertyAt(e){return e<this.allProperties().length?this.allProperties()[e]:null}pastLastSourcePropertyIndex(){for(let e=this.allProperties().length-1;e>=0;--e)if(this.allProperties()[e].range)return e+1;return 0}#On(e){const t=this.propertyAt(e);if(t&&t.range)return t.range.collapseToStart();if(!this.range)throw new Error("CSSStyleDeclaration.range is null");return this.range.collapseToEnd()}newBlankProperty(e){e=void 0===e?this.pastLastSourcePropertyIndex():e;return new at(this,e,"","",!1,!1,!0,!1,"",this.#On(e))}setText(e,t){return this.range&&this.styleSheetId?this.#Sn.setStyleText(this.styleSheetId,this.range,e,t):Promise.resolve(!1)}insertPropertyAt(e,t,n,r){this.newBlankProperty(e).setText(t+": "+n+";",!1,!0).then(r)}appendProperty(e,t,n){this.insertPropertyAt(this.allProperties().length,e,t,n)}}!function(e){e.Regular="Regular",e.Inline="Inline",e.Attributes="Attributes"}(ot||(ot={}));var ct=Object.freeze({__proto__:null,CSSStyleDeclaration:dt,get Type(){return ot}});class ht{cssModelInternal;styleSheetId;sourceURL;origin;style;constructor(e,t){if(this.cssModelInternal=e,this.styleSheetId=t.styleSheetId,this.styleSheetId){const e=this.getStyleSheetHeader(this.styleSheetId);this.sourceURL=e.sourceURL}this.origin=t.origin,this.style=new dt(this.cssModelInternal,this,t.style,ot.Regular)}rebase(e){this.styleSheetId===e.styleSheetId&&this.style.rebase(e)}resourceURL(){if(!this.styleSheetId)return t.DevToolsPath.EmptyUrlString;return this.getStyleSheetHeader(this.styleSheetId).resourceURL()}isUserAgent(){return"user-agent"===this.origin}isInjected(){return"injected"===this.origin}isViaInspector(){return"inspector"===this.origin}isRegular(){return"regular"===this.origin}cssModel(){return this.cssModelInternal}getStyleSheetHeader(e){const t=this.cssModelInternal.styleSheetHeaderForId(e);return console.assert(null!==t),t}}class ut{text;range;specificity;constructor(e){this.text=e.text,e.range&&(this.range=r.TextRange.TextRange.fromObject(e.range)),e.specificity&&(this.specificity=e.specificity)}rebase(e){this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}}class gt extends ht{selectors;nestingSelectors;media;containerQueries;supports;scopes;layers;wasUsed;constructor(e,t,n){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeSelectors(t.selectorList),this.nestingSelectors=t.nestingSelectors,this.media=t.media?et.parseMediaArrayPayload(e,t.media):[],this.containerQueries=t.containerQueries?Ve.parseContainerQueriesPayload(e,t.containerQueries):[],this.scopes=t.scopes?nt.parseScopesPayload(e,t.scopes):[],this.supports=t.supports?st.parseSupportsPayload(e,t.supports):[],this.layers=t.layers?Xe.parseLayerPayload(e,t.layers):[],this.wasUsed=n||!1}static createDummyRule(e,t){const n={selectorList:{text:"",selectors:[{text:t,value:void 0}]},style:{styleSheetId:"0",range:new r.TextRange.TextRange(0,0,0,0),shorthandEntries:[],cssProperties:[]},origin:"inspector"};return new gt(e,n)}reinitializeSelectors(e){this.selectors=[];for(let t=0;t<e.selectors.length;++t)this.selectors.push(new ut(e.selectors[t]))}setSelectorText(e){const t=this.styleSheetId;if(!t)throw"No rule stylesheet id";const n=this.selectorRange();if(!n)throw"Rule selector is not editable";return this.cssModelInternal.setSelectorText(t,n,e)}selectorText(){return this.selectors.map((e=>e.text)).join(", ")}selectorRange(){const e=this.selectors[0].range,t=this.selectors[this.selectors.length-1].range;return e&&t?new r.TextRange.TextRange(e.startLine,e.startColumn,t.endLine,t.endColumn):null}lineNumberInSource(e){const t=this.selectors[e];if(!t||!t.range||!this.styleSheetId)return 0;return this.getStyleSheetHeader(this.styleSheetId).lineNumberInSource(t.range.startLine)}columnNumberInSource(e){const t=this.selectors[e];if(!t||!t.range||!this.styleSheetId)return;return this.getStyleSheetHeader(this.styleSheetId).columnNumberInSource(t.range.startLine,t.range.startColumn)}rebase(e){if(this.styleSheetId!==e.styleSheetId)return;const t=this.selectorRange();if(t&&t.equal(e.oldRange))this.reinitializeSelectors(e.payload);else for(let t=0;t<this.selectors.length;++t)this.selectors[t].rebase(e);this.media.forEach((t=>t.rebase(e))),this.containerQueries.forEach((t=>t.rebase(e))),this.scopes.forEach((t=>t.rebase(e))),this.supports.forEach((t=>t.rebase(e))),super.rebase(e)}}class pt{#Nn;#Fn;constructor(e,t){this.#Nn=new ut(t.animationName),this.#Fn=t.keyframes.map((t=>new mt(e,t)))}name(){return this.#Nn}keyframes(){return this.#Fn}}class mt extends ht{#Bn;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeKey(t.keyText)}key(){return this.#Bn}reinitializeKey(e){this.#Bn=new ut(e)}rebase(e){this.styleSheetId===e.styleSheetId&&this.#Bn.range&&(e.oldRange.equal(this.#Bn.range)?this.reinitializeKey(e.payload):this.#Bn.rebase(e),super.rebase(e))}setKeyText(e){const t=this.styleSheetId;if(!t)throw"No rule stylesheet id";const n=this.#Bn.range;if(!n)throw"Keyframe key is not editable";return this.cssModelInternal.setKeyframeKey(t,n,e)}}class ft{#Dn;#Un;constructor(e,t){this.#Dn=new ut(t.name),this.#Un=t.tryRules.map((t=>new ht(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId})))}name(){return this.#Dn}tryRules(){return this.#Un}}var bt,yt=Object.freeze({__proto__:null,CSSRule:ht,CSSStyleRule:gt,CSSKeyframesRule:pt,CSSKeyframeRule:mt,CSSPositionFallbackRule:ft});function vt(e){const t=e.match(/var\(\s*(--(?:[\s\w\P{ASCII}-]|\\.)+),?\s*(.*)\s*\)/u);return{variableName:t&&t[1].trim(),fallback:t&&t[2]}}class It{#Sn;#Hn;#qn;#_n;#Fn;#zn;#jn;#Wn;#Vn;#Gn;#Kn;#$n;#Qn;constructor({cssModel:e,node:t,inlinePayload:n,attributesPayload:r,matchedPayload:s,pseudoPayload:i,inheritedPayload:a,inheritedPseudoPayload:o,animationsPayload:l,parentLayoutNodeId:d,positionFallbackRules:c}){this.#Sn=e,this.#Hn=t,this.#qn=new Map,this.#_n=new Map,this.#Fn=[],l&&(this.#Fn=l.map((t=>new pt(e,t)))),this.#Qn=c.map((t=>new ft(e,t))),this.#$n=d,this.#zn=new Map,this.#jn=new Set,s=h(s);for(const e of a)e.matchedCSSRules=h(e.matchedCSSRules);this.#Wn=this.buildMainCascade(n,r,s,a),[this.#Vn,this.#Gn]=this.buildPseudoCascades(i,o),this.#Kn=new Map;for(const e of Array.from(this.#Gn.values()).concat(Array.from(this.#Vn.values())).concat(this.#Wn))for(const t of e.styles())this.#Kn.set(t,e);function h(e){for(const t of e)s(t);const t=[];for(const s of e){const e=t[t.length-1];e&&"user-agent"===s.rule.origin&&"user-agent"===e.rule.origin&&s.rule.selectorList.text===e.rule.selectorList.text&&r(s)===r(e)?n(s,e):t.push(s)}return t;function n(e,t){const n=new Map,r=new Map;for(const e of t.rule.style.shorthandEntries)n.set(e.name,e.value);for(const e of t.rule.style.cssProperties)r.set(e.name,e.value);for(const t of e.rule.style.shorthandEntries)n.set(t.name,t.value);for(const t of e.rule.style.cssProperties)r.set(t.name,t.value);t.rule.style.shorthandEntries=[...n.entries()].map((([e,t])=>({name:e,value:t}))),t.rule.style.cssProperties=[...r.entries()].map((([e,t])=>({name:e,value:t})))}function r(e){return e.rule.media?e.rule.media.map((e=>e.text)).join(", "):null}function s(e){const{matchingSelectors:t,rule:n}=e;"user-agent"===n.origin&&t.length&&(n.selectorList.selectors=n.selectorList.selectors.filter(((e,n)=>t.includes(n))),n.selectorList.text=n.selectorList.selectors.map((e=>e.text)).join(", "),e.matchingSelectors=t.map(((e,t)=>t)))}}}buildMainCascade(e,t,n,r){const s=[],i=[];function a(){if(!t)return;const e=new dt(this.#Sn,null,t,ot.Attributes);this.#zn.set(e,this.#Hn),i.push(e)}if(e&&this.#Hn.nodeType()===Node.ELEMENT_NODE){const t=new dt(this.#Sn,null,e,ot.Inline);this.#zn.set(t,this.#Hn),i.push(t)}let o;for(let e=n.length-1;e>=0;--e){const t=new gt(this.#Sn,n[e].rule);!t.isInjected()&&!t.isUserAgent()||o||(o=!0,a.call(this)),this.#zn.set(t.style,this.#Hn),i.push(t.style),this.addMatchingSelectors(this.#Hn,t,n[e].matchingSelectors)}o||a.call(this),s.push(new kt(this,i,!1));let l=this.#Hn.parentNode;for(let e=0;l&&r&&e<r.length;++e){const t=[],n=r[e],a=n.inlineStyle?new dt(this.#Sn,null,n.inlineStyle,ot.Inline):null;a&&this.containsInherited(a)&&(this.#zn.set(a,l),t.push(a),this.#jn.add(a));const o=n.matchedCSSRules||[];for(let e=o.length-1;e>=0;--e){const n=new gt(this.#Sn,o[e].rule);this.addMatchingSelectors(l,n,o[e].matchingSelectors),this.containsInherited(n.style)&&(d(i,n.style)||d(this.#jn,n.style)||(this.#zn.set(n.style,l),t.push(n.style),this.#jn.add(n.style)))}l=l.parentNode,s.push(new kt(this,t,!0))}return new St(s);function d(e,t){if(!t.styleSheetId||!t.range)return!1;for(const n of e)if(t.styleSheetId===n.styleSheetId&&n.range&&t.range.equal(n.range))return!0;return!1}}buildSplitCustomHighlightCascades(e,t,n,r){const s=new Map;for(let r=e.length-1;r>=0;--r){const i=this.customHighlightNamesToMatchingSelectorIndices(e[r]);for(const[a,o]of i){const i=new gt(this.#Sn,e[r].rule);this.#zn.set(i.style,t),n&&this.#jn.add(i.style),this.addMatchingSelectors(t,i,o);const l=s.get(a);l?l.push(i.style):s.set(a,[i.style])}}for(const[e,t]of s){const s=new kt(this,t,n,!0),i=r.get(e);i?i.push(s):r.set(e,[s])}}customHighlightNamesToMatchingSelectorIndices(e){const t=new Map;for(let n=0;n<e.matchingSelectors.length;n++){const r=e.matchingSelectors[n],s=e.rule.selectorList.selectors[r].text.match(/::highlight\((.*)\)/);if(s){const e=s[1],n=t.get(e);n?n.push(r):t.set(e,[r])}}return t}buildPseudoCascades(e,t){const n=new Map,r=new Map;if(!e)return[n,r];const s=new Map,i=new Map;for(let t=0;t<e.length;++t){const n=e[t],r=this.#Hn.pseudoElements().get(n.pseudoType)?.at(-1)||null,a=[],o=n.matches||[];if("highlight"===n.pseudoType)this.buildSplitCustomHighlightCascades(o,this.#Hn,!1,i);else{for(let e=o.length-1;e>=0;--e){const t=new gt(this.#Sn,o[e].rule);a.push(t.style);const s=v().isHighlightPseudoType(n.pseudoType)?this.#Hn:r;this.#zn.set(t.style,s),s&&this.addMatchingSelectors(s,t,o[e].matchingSelectors)}const e=v().isHighlightPseudoType(n.pseudoType),t=new kt(this,a,!1,e);s.set(n.pseudoType,[t])}}if(t){let e=this.#Hn.parentNode;for(let n=0;e&&n<t.length;++n){const r=t[n].pseudoElements;for(let t=0;t<r.length;++t){const n=r[t],a=n.matches||[];if("highlight"===n.pseudoType)this.buildSplitCustomHighlightCascades(a,e,!0,i);else{const t=[];for(let n=a.length-1;n>=0;--n){const r=new gt(this.#Sn,a[n].rule);t.push(r.style),this.#zn.set(r.style,e),this.#jn.add(r.style),this.addMatchingSelectors(e,r,a[n].matchingSelectors)}const r=v().isHighlightPseudoType(n.pseudoType),i=new kt(this,t,!0,r),o=s.get(n.pseudoType);o?o.push(i):s.set(n.pseudoType,[i])}}e=e.parentNode}}for(const[e,t]of s.entries())n.set(e,new St(t));for(const[e,t]of i.entries())r.set(e,new St(t));return[n,r]}addMatchingSelectors(e,t,n){for(const r of n){const n=t.selectors[r];n&&this.setSelectorMatches(e,n.text,!0)}}node(){return this.#Hn}cssModel(){return this.#Sn}hasMatchingSelectors(e){return this.getMatchingSelectors(e).length>0&&this.queryMatches(e.style)}getParentLayoutNodeId(){return this.#$n}getMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t||"number"!=typeof t.id)return[];const n=this.#_n.get(t.id);if(!n)return[];const r=[];for(let t=0;t<e.selectors.length;++t)n.get(e.selectors[t].text)&&r.push(t);return r}async recomputeMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t)return;const n=[];for(const s of e.selectors)n.push(r.call(this,t,s.text));async function r(e,t){const n=e.ownerDocument;if(!n)return;if("number"==typeof e.id){const n=this.#_n.get(e.id);if(n&&n.has(t))return}if("number"!=typeof n.id)return;const r=await this.#Hn.domModel().querySelectorAll(n.id,t);r&&("number"==typeof e.id?this.setSelectorMatches(e,t,-1!==r.indexOf(e.id)):this.setSelectorMatches(e,t,!1))}await Promise.all(n)}addNewRule(e,t){return this.#qn.set(e.style,t),this.recomputeMatchingSelectors(e)}setSelectorMatches(e,t,n){if("number"!=typeof e.id)return;let r=this.#_n.get(e.id);r||(r=new Map,this.#_n.set(e.id,r)),r.set(t,n)}queryMatches(e){if(!e.parentRule)return!0;const t=e.parentRule,n=[...t.media,...t.containerQueries,...t.supports,...t.scopes];for(const e of n)if(!e.active())return!1;return!0}nodeStyles(){return this.#Wn.styles()}keyframes(){return this.#Fn}positionFallbackRules(){return this.#Qn}pseudoStyles(e){const t=this.#Vn.get(e);return t?t.styles():[]}pseudoTypes(){return new Set(this.#Vn.keys())}customHighlightPseudoStyles(e){const t=this.#Gn.get(e);return t?t.styles():[]}customHighlightPseudoNames(){return new Set(this.#Gn.keys())}containsInherited(e){const t=e.allProperties();for(let e=0;e<t.length;++e){const n=t[e];if(n.activeInStyle()&&v().isPropertyInherited(n.name))return!0}return!1}nodeForStyle(e){return this.#qn.get(e)||this.#zn.get(e)||null}availableCSSVariables(e){const t=this.#Kn.get(e)||null;return t?t.findAvailableCSSVariables(e):[]}computeCSSVariable(e,t){const n=this.#Kn.get(e)||null;return n?n.computeCSSVariable(e,t):null}computeValue(e,t){const n=this.#Kn.get(e)||null;return n?n.computeValue(e,t):null}computeSingleVariableValue(e,t){const n=this.#Kn.get(e)||null;return n?n.computeSingleVariableValue(e,t):null}isInherited(e){return this.#jn.has(e)}propertyState(e){const t=this.#Kn.get(e.ownerStyle);return t?t.propertyState(e):null}resetActiveProperties(){this.#Wn.reset();for(const e of this.#Vn.values())e.reset();for(const e of this.#Gn.values())e.reset()}}class kt{#Xn;styles;#Jn;#Yn;propertiesState;activeProperties;constructor(e,t,n,r=!1){this.#Xn=e,this.styles=t,this.#Jn=n,this.#Yn=r,this.propertiesState=new Map,this.activeProperties=new Map}computeActiveProperties(){this.propertiesState.clear(),this.activeProperties.clear();for(let e=this.styles.length-1;e>=0;e--){const t=this.styles[e],n=t.parentRule;if((!n||n instanceof gt)&&(!n||this.#Xn.hasMatchingSelectors(n)))for(const e of t.allProperties()){const n=v();if(this.#Jn&&!this.#Yn&&!n.isPropertyInherited(e.name))continue;if(t.range&&!e.range)continue;if(!e.activeInStyle()){this.propertiesState.set(e,bt.Overloaded);continue}const r=n.canonicalPropertyName(e.name);this.updatePropertyState(e,r);for(const t of e.getLonghandProperties())n.isCSSPropertyName(t.name)&&this.updatePropertyState(t,t.name)}}}updatePropertyState(e,t){const n=this.activeProperties.get(t);!n?.important||e.important?(n&&this.propertiesState.set(n,bt.Overloaded),this.propertiesState.set(e,bt.Active),this.activeProperties.set(t,e)):this.propertiesState.set(e,bt.Overloaded)}}class St{#Zn;#er;#tr;#nr;#rr;#sr;constructor(e){this.#Zn=e,this.#er=new Map,this.#tr=new Map,this.#nr=new Map,this.#rr=!1,this.#sr=new Map;for(const t of e)for(const e of t.styles)this.#sr.set(e,t)}findAvailableCSSVariables(e){const t=this.#sr.get(e);if(!t)return[];this.ensureInitialized();const n=this.#tr.get(t);return n?Array.from(n.keys()):[]}computeCSSVariable(e,t){const n=this.#sr.get(e);if(!n)return null;this.ensureInitialized();const r=this.#tr.get(n),s=this.#nr.get(n);return r&&s?this.innerComputeCSSVariable(r,s,t):null}computeValue(e,t){const n=this.#sr.get(e);if(!n)return null;this.ensureInitialized();const r=this.#tr.get(n),s=this.#nr.get(n);return r&&s?this.innerComputeValue(r,s,t):null}computeSingleVariableValue(e,t){const n=this.#sr.get(e);if(!n)return null;this.ensureInitialized();const r=this.#tr.get(n),s=this.#nr.get(n);if(!r||!s)return null;const i=this.innerComputeValue(r,s,t),{variableName:a}=vt(t);return{computedValue:i,fromFallback:null!==a&&!r.has(a)}}innerComputeCSSVariable(e,t,n){if(!e.has(n))return null;if(t.has(n))return t.get(n)||null;t.set(n,null);const r=e.get(n);if(null==r)return null;const s=this.innerComputeValue(e,t,r);return t.set(n,s),s}innerComputeValue(e,t,n){const s=r.TextUtils.Utils.splitStringByRegexes(n,[f]),i=[];for(const n of s){if(-1===n.regexIndex){i.push(n.value);continue}const{variableName:r,fallback:s}=vt(n.value);if(!r)return null;const a=this.innerComputeCSSVariable(e,t,r);if(null===a&&!s)return null;null===a?i.push(s):i.push(a)}return i.map((e=>e?e.trim():"")).join(" ")}styles(){return Array.from(this.#sr.keys())}propertyState(e){return this.ensureInitialized(),this.#er.get(e)||null}reset(){this.#rr=!1,this.#er.clear(),this.#tr.clear(),this.#nr.clear()}ensureInitialized(){if(this.#rr)return;this.#rr=!0;const e=new Map;for(const t of this.#Zn){t.computeActiveProperties();for(const[n,r]of t.propertiesState){if(r===bt.Overloaded){this.#er.set(n,bt.Overloaded);continue}const t=v().canonicalPropertyName(n.name);e.has(t)?this.#er.set(n,bt.Overloaded):(e.set(t,n),this.#er.set(n,bt.Active))}}for(const[t,n]of e){const r=n.ownerStyle,s=n.getLonghandProperties();if(!s.length)continue;let i=!1;for(const t of s){const n=v().canonicalPropertyName(t.name),s=e.get(n);if(s&&s.ownerStyle===r){i=!0;break}}i||(e.delete(t),this.#er.set(n,bt.Overloaded))}const t=new Map;for(let e=this.#Zn.length-1;e>=0;--e){const n=this.#Zn[e],r=[];for(const e of n.activeProperties.entries()){const n=e[0],s=e[1];n.startsWith("--")&&(t.set(n,s.value),r.push(n))}const s=new Map(t),i=new Map;this.#tr.set(n,s),this.#nr.set(n,i);for(const e of r)t.delete(e),t.set(e,this.innerComputeCSSVariable(s,i,e))}}}!function(e){e.Active="Active",e.Overloaded="Overloaded"}(bt||(bt={}));var wt=Object.freeze({__proto__:null,parseCSSVariableNameAndFallback:vt,CSSMatchedStyles:It,get PropertyState(){return bt}});const Ct={couldNotFindTheOriginalStyle:"Could not find the original style sheet.",thereWasAnErrorRetrievingThe:"There was an error retrieving the source styles."},Tt=s.i18n.registerUIStrings("core/sdk/CSSStyleSheetHeader.ts",Ct),Rt=s.i18n.getLocalizedString.bind(void 0,Tt);class xt{#Sn;id;frameId;sourceURL;hasSourceURL;origin;title;disabled;isInline;isMutable;isConstructed;startLine;startColumn;endLine;endColumn;contentLength;ownerNode;sourceMapURL;loadingFailed;#ir;constructor(e,t){this.#Sn=e,this.id=t.styleSheetId,this.frameId=t.frameId,this.sourceURL=t.sourceURL,this.hasSourceURL=Boolean(t.hasSourceURL),this.origin=t.origin,this.title=t.title,this.disabled=t.disabled,this.isInline=t.isInline,this.isMutable=t.isMutable,this.isConstructed=t.isConstructed,this.startLine=t.startLine,this.startColumn=t.startColumn,this.endLine=t.endLine,this.endColumn=t.endColumn,this.contentLength=t.length,t.ownerNode&&(this.ownerNode=new Rn(e.target(),t.ownerNode)),this.sourceMapURL=t.sourceMapURL,this.loadingFailed=t.loadingFailed??!1,this.#ir=null}originalContentProvider(){if(!this.#ir){const e=async()=>{const e=await this.#Sn.originalStyleSheetText(this);return null===e?{content:null,error:Rt(Ct.couldNotFindTheOriginalStyle),isEncoded:!1}:{content:e,isEncoded:!1}};this.#ir=new r.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),e)}return this.#ir}setSourceMapURL(e){this.sourceMapURL=e}cssModel(){return this.#Sn}isAnonymousInlineStyleSheet(){return!this.resourceURL()&&!this.#Sn.sourceMapManager().sourceMapForClient(this)}isConstructedByNew(){return this.isConstructed&&0===this.sourceURL.length}resourceURL(){const e=this.isViaInspector()?this.viaInspectorResourceURL():this.sourceURL;return!e&&o.Runtime.experiments.isEnabled(o.Runtime.ExperimentName.STYLES_PANE_CSS_CHANGES)?this.dynamicStyleURL():e}getFrameURLPath(){const t=this.#Sn.target().model(jn);if(console.assert(Boolean(t)),!t)return"";const n=t.frameForId(this.frameId);if(!n)return"";console.assert(Boolean(n));const r=new e.ParsedURL.ParsedURL(n.url);let s=r.host+r.folderPathComponents;return s.endsWith("/")||(s+="/"),s}viaInspectorResourceURL(){return`inspector://${this.getFrameURLPath()}inspector-stylesheet`}dynamicStyleURL(){return`stylesheet://${this.getFrameURLPath()}style#${this.id}`}lineNumberInSource(e){return this.startLine+e}columnNumberInSource(e,t){return(e?0:this.startColumn)+t}containsLocation(e,t){const n=e===this.startLine&&t>=this.startColumn||e>this.startLine,r=e<this.endLine||e===this.endLine&&t<=this.endColumn;return n&&r}contentURL(){return this.resourceURL()}contentType(){return e.ResourceType.resourceTypes.Stylesheet}async requestContent(){try{return{content:await this.#Sn.getStyleSheetText(this.id),isEncoded:!1}}catch(e){return{content:null,error:Rt(Ct.thereWasAnErrorRetrievingThe),isEncoded:!1}}}async searchInContent(e,t,n){const s=await this.requestContent();return null===s.content?[]:r.TextUtils.performSearchInContent(s.content,e,t,n)}isViaInspector(){return"inspector"===this.origin}createPageResourceLoadInitiator(){return{target:null,frameId:this.frameId,initiatorUrl:this.hasSourceURL?t.DevToolsPath.EmptyUrlString:this.sourceURL}}}var Mt=Object.freeze({__proto__:null,CSSStyleSheetHeader:xt});let Pt=null;class Lt extends e.ObjectWrapper.ObjectWrapper{#ar=new WeakMap;#or=new Map;#lr=new Map;#dr=null;#cr=new Map;#hr=new Map;constructor(){super(),K.instance().observeModels(jn,this)}static instance({forceNew:e}={forceNew:!1}){return Pt&&!e||(Pt=new Lt),Pt}modelAdded(e){const t=e.addEventListener(_n.FrameAdded,this.frameAdded,this),n=e.addEventListener(_n.FrameDetached,this.frameDetached,this),r=e.addEventListener(_n.FrameNavigated,this.frameNavigated,this),s=e.addEventListener(_n.ResourceAdded,this.resourceAdded,this);this.#ar.set(e,[t,n,r,s]),this.#lr.set(e.target().id(),new Set)}modelRemoved(t){const n=this.#ar.get(t);n&&e.EventTarget.removeEventListeners(n);const r=this.#lr.get(t.target().id());if(r)for(const e of r)this.decreaseOrRemoveFrame(e);this.#lr.delete(t.target().id())}frameAdded(e){const t=e.data,n=this.#or.get(t.id);if(n)t.setCreationStackTrace(n.frame.getCreationStackTraceData()),this.#or.set(t.id,{frame:t,count:n.count+1});else{const e=this.#cr.get(t.id);e?.creationStackTrace&&e?.creationStackTraceTarget&&t.setCreationStackTrace({creationStackTrace:e.creationStackTrace,creationStackTraceTarget:e.creationStackTraceTarget}),this.#or.set(t.id,{frame:t,count:1}),this.#cr.delete(t.id)}this.resetOutermostFrame();const r=this.#lr.get(t.resourceTreeModel().target().id());r&&r.add(t.id),this.dispatchEventToListeners(Et.FrameAddedToTarget,{frame:t}),this.resolveAwaitedFrame(t)}frameDetached(e){const{frame:t,isSwap:n}=e.data;if(this.decreaseOrRemoveFrame(t.id),n&&!this.#or.get(t.id)){const e=t.getCreationStackTraceData(),n={...e.creationStackTrace&&{creationStackTrace:e.creationStackTrace},...e.creationStackTrace&&{creationStackTraceTarget:e.creationStackTraceTarget}};this.#cr.set(t.id,n)}const r=this.#lr.get(t.resourceTreeModel().target().id());r&&r.delete(t.id)}frameNavigated(e){const t=e.data;this.dispatchEventToListeners(Et.FrameNavigated,{frame:t}),t.isOutermostFrame()&&this.dispatchEventToListeners(Et.OutermostFrameNavigated,{frame:t})}resourceAdded(e){this.dispatchEventToListeners(Et.ResourceAdded,{resource:e.data})}decreaseOrRemoveFrame(e){const t=this.#or.get(e);t&&(1===t.count?(this.#or.delete(e),this.resetOutermostFrame(),this.dispatchEventToListeners(Et.FrameRemoved,{frameId:e})):t.count--)}resetOutermostFrame(){const e=this.getAllFrames().filter((e=>e.isOutermostFrame()));this.#dr=e.length>0?e[0]:null}getFrame(e){const t=this.#or.get(e);return t?t.frame:null}getAllFrames(){return Array.from(this.#or.values(),(e=>e.frame))}getOutermostFrame(){return this.#dr}async getOrWaitForFrame(e,t){const n=this.getFrame(e);return!n||t&&t===n.resourceTreeModel().target()?new Promise((n=>{const r=this.#hr.get(e);r?r.push({notInTarget:t,resolve:n}):this.#hr.set(e,[{notInTarget:t,resolve:n}])})):n}resolveAwaitedFrame(e){const t=this.#hr.get(e.id);if(!t)return;const n=t.filter((({notInTarget:t,resolve:n})=>!(!t||t!==e.resourceTreeModel().target())||(n(e),!1)));n.length>0?this.#hr.set(e.id,n):this.#hr.delete(e.id)}}var Et;!function(e){e.FrameAddedToTarget="FrameAddedToTarget",e.FrameNavigated="FrameNavigated",e.FrameRemoved="FrameRemoved",e.ResourceAdded="ResourceAdded",e.OutermostFrameNavigated="OutermostFrameNavigated"}(Et||(Et={}));var At=Object.freeze({__proto__:null,FrameManager:Lt,get Events(){return Et}});class Ot extends c{constructor(e){super(e)}async read(t,n,r){const s=await this.target().ioAgent().invoke_read({handle:t,offset:r,size:n});if(s.getError())throw new Error(s.getError());return s.eof?null:s.base64Encoded?e.Base64.decode(s.data):s.data}async close(e){(await this.target().ioAgent().invoke_close({handle:e})).getError()&&console.error("Could not close stream.")}async resolveBlob(e){const t=e instanceof Le?e.objectId:e;if(!t)throw new Error("Remote object has undefined objectId");const n=await this.target().ioAgent().invoke_resolveBlob({objectId:t});if(n.getError())throw new Error(n.getError());return`blob:${n.uuid}`}async readToString(e){const t=[],n=new TextDecoder;for(;;){const r=await this.read(e,1048576);if(null===r){t.push(n.decode());break}r instanceof ArrayBuffer?t.push(n.decode(r,{stream:!0})):t.push(r)}return t.join("")}}c.register(Ot,{capabilities:z.IO,autostart:!0});var Nt=Object.freeze({__proto__:null,IOModel:Ot});const Ft={loadCanceledDueToReloadOf:"Load canceled due to reload of inspected page"},Bt=s.i18n.registerUIStrings("core/sdk/PageResourceLoader.ts",Ft),Dt=s.i18n.getLocalizedString.bind(void 0,Bt);let Ut=null;class Ht extends e.ObjectWrapper.ObjectWrapper{#ur;#gr;#pr;#mr;#fr;constructor(e,t){super(),this.#ur=0,this.#gr=t,this.#pr=new Map,this.#mr=[],K.instance().addModelListener(jn,_n.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.#fr=e}static instance({forceNew:e,loadOverride:t,maxConcurrentLoads:n}={forceNew:!1,loadOverride:null,maxConcurrentLoads:500}){return Ut&&!e||(Ut=new Ht(t,n)),Ut}static removeInstance(){Ut=null}onPrimaryPageChanged(e){if(e.data.frame.isOutermostFrame()){for(const{reject:e}of this.#mr)e(new Error(Dt(Ft.loadCanceledDueToReloadOf)));this.#mr=[],this.#pr.clear(),this.dispatchEventToListeners(_t.Update)}}getResourcesLoaded(){return this.#pr}getNumberOfResources(){return{loading:this.#ur,queued:this.#mr.length,resources:this.#pr.size}}async acquireLoadSlot(){if(this.#ur++,this.#ur>this.#gr){const e={resolve:()=>{},reject:()=>{}},t=new Promise(((t,n)=>{e.resolve=t,e.reject=n}));this.#mr.push(e),await t}}releaseLoadSlot(){this.#ur--;const e=this.#mr.shift();e&&e.resolve()}static makeKey(e,t){if(t.frameId)return`${e}-${t.frameId}`;if(t.target)return`${e}-${t.target.id()}`;throw new Error("Invalid initiator")}async loadResource(e,t){const n=Ht.makeKey(e,t),r={success:null,size:null,errorMessage:void 0,url:e,initiator:t};this.#pr.set(n,r),this.dispatchEventToListeners(_t.Update);try{await this.acquireLoadSlot();const n=this.dispatchLoad(e,t),s=await n;if(r.errorMessage=s.errorDescription.message,r.success=s.success,s.success)return r.size=s.content.length,{content:s.content};throw new Error(s.errorDescription.message)}catch(e){throw void 0===r.errorMessage&&(r.errorMessage=e.message),null===r.success&&(r.success=!1),e}finally{this.releaseLoadSlot(),this.dispatchEventToListeners(_t.Update)}}async dispatchLoad(t,n){let r=null;if(this.#fr)return this.#fr(t);const s=new e.ParsedURL.ParsedURL(t),a=qt().get()&&s&&"file"!==s.scheme&&"data"!==s.scheme&&"devtools"!==s.scheme;if(i.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(s)),a){try{if(n.target){i.userMetrics.developerResourceLoaded(i.UserMetrics.DeveloperResourceLoaded.LoadThroughPageViaTarget);return await this.loadFromTarget(n.target,n.frameId,t)}const e=Lt.instance().getFrame(n.frameId);if(e){i.userMetrics.developerResourceLoaded(i.UserMetrics.DeveloperResourceLoaded.LoadThroughPageViaFrame);return await this.loadFromTarget(e.resourceTreeModel().target(),n.frameId,t)}}catch(e){e instanceof Error&&(i.userMetrics.developerResourceLoaded(i.UserMetrics.DeveloperResourceLoaded.LoadThroughPageFailure),r=e.message)}i.userMetrics.developerResourceLoaded(i.UserMetrics.DeveloperResourceLoaded.LoadThroughPageFallback),console.warn("Fallback triggered",t,n)}else{const e=qt().get()?i.UserMetrics.DeveloperResourceLoaded.FallbackPerProtocol:i.UserMetrics.DeveloperResourceLoaded.FallbackPerOverride;i.userMetrics.developerResourceLoaded(e)}const o=await ue.instance().loadResource(t);return a&&!o.success&&i.userMetrics.developerResourceLoaded(i.UserMetrics.DeveloperResourceLoaded.FallbackFailure),r&&(o.errorDescription.message=`Fetch through target failed: ${r}; Fallback: ${o.errorDescription.message}`),o}getDeveloperResourceScheme(e){if(!e||""===e.scheme)return i.UserMetrics.DeveloperResourceScheme.SchemeUnknown;const t="localhost"===e.host||e.host.endsWith(".localhost");switch(e.scheme){case"file":return i.UserMetrics.DeveloperResourceScheme.SchemeFile;case"data":return i.UserMetrics.DeveloperResourceScheme.SchemeData;case"blob":return i.UserMetrics.DeveloperResourceScheme.SchemeBlob;case"http":return t?i.UserMetrics.DeveloperResourceScheme.SchemeHttpLocalhost:i.UserMetrics.DeveloperResourceScheme.SchemeHttp;case"https":return t?i.UserMetrics.DeveloperResourceScheme.SchemeHttpsLocalhost:i.UserMetrics.DeveloperResourceScheme.SchemeHttps}return i.UserMetrics.DeveloperResourceScheme.SchemeOther}async loadFromTarget(t,n,r){const s=t.model(ne),a=t.model(Ot),o=e.Settings.Settings.instance().moduleSetting("cacheDisabled").get(),l=await s.loadNetworkResource(n,r,{disableCache:o,includeCredentials:!0});try{const e=l.stream?await a.readToString(l.stream):"";return{success:l.success,content:e,errorDescription:{statusCode:l.httpStatusCode||0,netError:l.netError,netErrorName:l.netErrorName,message:i.ResourceLoader.netErrorToMessage(l.netError,l.httpStatusCode,l.netErrorName)||"",urlValid:void 0}}}finally{l.stream&&a.close(l.stream)}}}function qt(){return e.Settings.Settings.instance().createSetting("loadThroughTarget",!0)}var _t;(_t||(_t={})).Update="Update";var zt=Object.freeze({__proto__:null,PageResourceLoader:Ht,getLoadThroughTargetSetting:qt,get Events(){return _t}});function jt(e){return e.startsWith(")]}")&&(e=e.substring(e.indexOf("\n"))),65279===e.charCodeAt(0)&&(e=e.slice(1)),JSON.parse(e)}class Wt{lineNumber;columnNumber;sourceURL;sourceLineNumber;sourceColumnNumber;name;constructor(e,t,n,r,s,i){this.lineNumber=e,this.columnNumber=t,this.sourceURL=n,this.sourceLineNumber=r,this.sourceColumnNumber=s,this.name=i}static compare(e,t){return e.lineNumber!==t.lineNumber?e.lineNumber-t.lineNumber:e.columnNumber-t.columnNumber}}const Vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gt=new Map;for(let e=0;e<Vt.length;++e)Gt.set(Vt.charAt(e),e);const Kt=new WeakMap;class $t{#br;#yr;#vr;#Ir;#kr;#Sr;constructor(t,n,r){this.#br=r,this.#yr=t,this.#vr=n,this.#Ir=n.startsWith("data:")?t:n,this.#kr=null,this.#Sr=new Map,"sections"in this.#br&&this.#br.sections.find((e=>"url"in e))&&e.Console.Console.instance().warn(`SourceMap "${n}" contains unsupported "URL" field in one of its sections.`),this.eachSection(this.parseSources.bind(this))}compiledURL(){return this.#yr}url(){return this.#vr}sourceURLs(){return[...this.#Sr.keys()]}embeddedContentByURL(e){const t=this.#Sr.get(e);return t?t.content:null}findEntry(e,n){const r=this.mappings(),s=t.ArrayUtilities.upperBound(r,void 0,((t,r)=>e-r.lineNumber||n-r.columnNumber));return s?r[s-1]:null}findEntryRanges(e,n){const s=this.mappings(),i=t.ArrayUtilities.upperBound(s,void 0,((t,r)=>e-r.lineNumber||n-r.columnNumber));if(!i)return null;const a=i-1,o=s[a].sourceURL;if(!o)return null;const l=i<s.length?s[i].lineNumber:2**31-1,d=i<s.length?s[i].columnNumber:2**31-1,c=new r.TextRange.TextRange(s[a].lineNumber,s[a].columnNumber,l,d),h=this.reversedMappings(o),u=s[a].sourceLineNumber,g=s[a].sourceColumnNumber,p=t.ArrayUtilities.upperBound(h,void 0,((e,t)=>u-s[t].sourceLineNumber||g-s[t].sourceColumnNumber));if(!p)return null;const m=p<h.length?s[h[p]].sourceLineNumber:2**31-1,f=p<h.length?s[h[p]].sourceColumnNumber:2**31-1;return{range:c,sourceRange:new r.TextRange.TextRange(u,g,m,f),sourceURL:o}}sourceLineMapping(e,n,r){const s=this.mappings(),i=this.reversedMappings(e),a=t.ArrayUtilities.lowerBound(i,n,c),o=t.ArrayUtilities.upperBound(i,n,c);if(a>=i.length||s[i[a]].sourceLineNumber!==n)return null;const l=i.slice(a,o);if(!l.length)return null;const d=t.ArrayUtilities.lowerBound(l,r,((e,t)=>e-s[t].sourceColumnNumber));return d>=l.length?s[l[l.length-1]]:s[l[d]];function c(e,t){return e-s[t].sourceLineNumber}}findReverseIndices(e,n,r){const s=this.mappings(),i=this.reversedMappings(e),a=t.ArrayUtilities.upperBound(i,void 0,((e,t)=>n-s[t].sourceLineNumber||r-s[t].sourceColumnNumber));let o=a;for(;o>0&&s[i[o-1]].sourceLineNumber===s[i[a-1]].sourceLineNumber&&s[i[o-1]].sourceColumnNumber===s[i[a-1]].sourceColumnNumber;)--o;return i.slice(o,a)}findReverseEntries(e,t,n){const r=this.mappings();return this.findReverseIndices(e,t,n).map((e=>r[e]))}findReverseRanges(e,t,n){const s=this.mappings(),i=this.findReverseIndices(e,t,n),a=[];for(let e=0;e<i.length;++e){const t=i[e];let n=t+1;for(;e+1<i.length&&n===i[e+1];)++n,++e;const o=s[t].lineNumber,l=s[t].columnNumber,d=n<s.length?s[n].lineNumber:2**31-1,c=n<s.length?s[n].columnNumber:2**31-1;a.push(new r.TextRange.TextRange(o,l,d,c))}return a}mappings(){return this.#wr(),this.#kr??[]}reversedMappings(e){return this.#wr(),this.#Sr.get(e)?.reverseMappings??[]}#wr(){null===this.#kr&&(this.#kr=[],this.eachSection(this.parseMap.bind(this)),this.mappings().sort(Wt.compare),this.#Cr(this.#kr),this.#br=null)}#Cr(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n].sourceURL;if(!r)continue;let s=t.get(r);s||(s=[],t.set(r,s)),s.push(n)}for(const[e,r]of t.entries()){const t=this.#Sr.get(e);t&&(r.sort(n),t.reverseMappings=r)}function n(t,n){const r=e[t],s=e[n];return r.sourceLineNumber-s.sourceLineNumber||r.sourceColumnNumber-s.sourceColumnNumber||r.lineNumber-s.lineNumber||r.columnNumber-s.columnNumber}}eachSection(e){if(this.#br)if("sections"in this.#br)for(const t of this.#br.sections)"map"in t&&e(t.map,t.offset.line,t.offset.column);else e(this.#br,0,0)}parseSources(t){const n=[],r=t.sourceRoot??"",s=new Set(t.x_google_ignoreList);for(let i=0;i<t.sources.length;++i){let a=t.sources[i];e.ParsedURL.ParsedURL.isRelativeURL(a)&&(a=r&&!r.endsWith("/")&&a&&!a.startsWith("/")?r.concat("/",a):r.concat(a));const o=e.ParsedURL.ParsedURL.completeURL(this.#Ir,a)||a,l=t.sourcesContent&&t.sourcesContent[i];if(n.push(o),!this.#Sr.has(o)){const e=l??null,t=s.has(i);this.#Sr.set(o,{content:e,ignoreListHint:t,reverseMappings:null})}}Kt.set(t,n)}parseMap(e,t,n){let r=0,s=0,i=0,a=0;const o=Kt.get(e),l=e.names??[],d=new $t.StringCharIterator(e.mappings);let c=o&&o[r];for(;;){if(","===d.peek())d.next();else{for(;";"===d.peek();)t+=1,n=0,d.next();if(!d.hasNext())break}if(n+=this.decodeVLQ(d),!d.hasNext()||this.isSeparator(d.peek())){this.mappings().push(new Wt(t,n));continue}const e=this.decodeVLQ(d);e&&(r+=e,o&&(c=o[r])),s+=this.decodeVLQ(d),i+=this.decodeVLQ(d),d.hasNext()&&!this.isSeparator(d.peek())?(a+=this.decodeVLQ(d),this.mappings().push(new Wt(t,n,c,s,i,l[a]))):this.mappings().push(new Wt(t,n,c,s,i))}}isSeparator(e){return","===e||";"===e}decodeVLQ(e){let t=0,n=0,r=$t._VLQ_CONTINUATION_MASK;for(;r&$t._VLQ_CONTINUATION_MASK;)r=Gt.get(e.next())||0,t+=(r&$t._VLQ_BASE_MASK)<<n,n+=$t._VLQ_BASE_SHIFT;const s=1&t;return t>>=1,s?-t:t}reverseMapTextRanges(e,n){const s=this.reversedMappings(e),i=this.mappings();if(0===s.length)return[];let a=t.ArrayUtilities.lowerBound(s,n,(({startLine:e,startColumn:t},n)=>{const{sourceLineNumber:r,sourceColumnNumber:s}=i[n];return e-r||t-s}));for(;a===s.length||a>0&&(i[s[a]].sourceLineNumber>n.startLine||i[s[a]].sourceColumnNumber>n.startColumn);)a--;let o=a+1;for(;o<s.length;++o){const{sourceLineNumber:e,sourceColumnNumber:t}=i[s[o]];if(!(e<n.endLine||e===n.endLine&&t<n.endColumn))break}const l=[];for(let e=a;e<o;++e){const t=s[e],n=t+1,a=r.TextRange.TextRange.createUnboundedFromLocation(i[t].lineNumber,i[t].columnNumber);n<i.length&&(a.endLine=i[n].lineNumber,a.endColumn=i[n].columnNumber),l.push(a)}l.sort(r.TextRange.TextRange.comparator);let d=0;for(let e=1;e<l.length;++e)l[d].immediatelyPrecedes(l[e])?(l[d].endLine=l[e].endLine,l[d].endColumn=l[e].endColumn):l[++d]=l[e];return l.length=d+1,l}mapsOrigin(){const e=this.mappings();if(e.length>0){const t=e[0];return 0===t?.lineNumber||0===t.columnNumber}return!1}hasIgnoreListHint(e){return this.#Sr.get(e)?.ignoreListHint??!1}findRanges(e,t){const n=this.mappings(),s=[];if(!n.length)return[];let i=null;0===n[0].lineNumber&&0===n[0].columnNumber||!t?.isStartMatching||(i=r.TextRange.TextRange.createUnboundedFromLocation(0,0),s.push(i));for(const{sourceURL:t,lineNumber:a,columnNumber:o}of n){const n=t&&e(t);i||!n?i&&!n&&(i.endLine=a,i.endColumn=o,i=null):(i=r.TextRange.TextRange.createUnboundedFromLocation(a,o),s.push(i))}return s}compatibleForURL(e,t){return this.embeddedContentByURL(e)===t.embeddedContentByURL(e)&&this.hasIgnoreListHint(e)===t.hasIgnoreListHint(e)}}!function(e){e._VLQ_BASE_SHIFT=5,e._VLQ_BASE_MASK=31,e._VLQ_CONTINUATION_MASK=32;e.StringCharIterator=class{string;position;constructor(e){this.string=e,this.position=0}next(){return this.string.charAt(this.position++)}peek(){return this.string.charAt(this.position)}hasNext(){return this.position<this.string.length}}}($t||($t={}));var Qt,Xt=Object.freeze({__proto__:null,parseSourceMap:jt,SourceMapEntry:Wt,get SourceMap(){return $t}});class Jt extends e.ObjectWrapper.ObjectWrapper{#h;#Tr;#Rr;#xr;constructor(e){super(),this.#h=e,this.#Tr=!0,this.#Rr=new Map,this.#xr=new Map,K.instance().addEventListener($.InspectedURLChanged,this.inspectedURLChanged,this)}setEnabled(e){if(e===this.#Tr)return;const t=[...this.#Rr.entries()];for(const[e]of t)this.detachSourceMap(e);this.#Tr=e;for(const[e,{relativeSourceURL:n,relativeSourceMapURL:r}]of t)this.attachSourceMap(e,n,r)}static getBaseUrl(e){for(;e&&e.type()!==_.Frame;)e=e.parentTarget();return e?.inspectedURL()??t.DevToolsPath.EmptyUrlString}static resolveRelativeSourceURL(t,n){return n=e.ParsedURL.ParsedURL.completeURL(Jt.getBaseUrl(t),n)??n}inspectedURLChanged(e){if(e.data!==this.#h)return;const t=[...this.#Rr.entries()];for(const[e,{relativeSourceURL:n,relativeSourceMapURL:r}]of t)this.detachSourceMap(e),this.attachSourceMap(e,n,r)}sourceMapForClient(e){return this.#Rr.get(e)?.sourceMap}sourceMapForClientPromise(e){const t=this.#Rr.get(e);return t?t.sourceMapPromise:Promise.resolve(void 0)}clientForSourceMap(e){return this.#xr.get(e)}attachSourceMap(t,n,r){if(this.#Rr.has(t))throw new Error("SourceMap is already attached or being attached to client");if(!r)return;const s={relativeSourceURL:n,relativeSourceMapURL:r,sourceMap:void 0,sourceMapPromise:Promise.resolve(void 0)};if(this.#Tr){const i=Jt.resolveRelativeSourceURL(this.#h,n),a=e.ParsedURL.ParsedURL.completeURL(i,r);if(a){this.dispatchEventToListeners(Qt.SourceMapWillAttach,{client:t});const n=t.createPageResourceLoadInitiator();s.sourceMapPromise=async function(e,t){try{const{content:n}=await Ht.instance().loadResource(e,t);return jt(n)}catch(t){throw new Error(`Could not load content for ${e}: ${t.message}`,{cause:t})}}(a,n).then((e=>{const n=new $t(i,a,e);return this.#Rr.get(t)===s&&(s.sourceMap=n,this.#xr.set(n,t),this.dispatchEventToListeners(Qt.SourceMapAttached,{client:t,sourceMap:n})),n}),(n=>{e.Console.Console.instance().warn(`DevTools failed to load source map: ${n.message}`),this.#Rr.get(t)===s&&this.dispatchEventToListeners(Qt.SourceMapFailedToAttach,{client:t})}))}}this.#Rr.set(t,s)}detachSourceMap(e){const t=this.#Rr.get(e);if(!t)return;if(this.#Rr.delete(e),!this.#Tr)return;const{sourceMap:n}=t;n?(this.#xr.delete(n),this.dispatchEventToListeners(Qt.SourceMapDetached,{client:e,sourceMap:n})):this.dispatchEventToListeners(Qt.SourceMapFailedToAttach,{client:e})}dispose(){K.instance().removeEventListener($.InspectedURLChanged,this.inspectedURLChanged,this)}}!function(e){e.SourceMapWillAttach="SourceMapWillAttach",e.SourceMapFailedToAttach="SourceMapFailedToAttach",e.SourceMapAttached="SourceMapAttached",e.SourceMapDetached="SourceMapDetached"}(Qt||(Qt={}));var Yt,Zt=Object.freeze({__proto__:null,SourceMapManager:Jt,get Events(){return Qt}});class en extends c{agent;#Mr;#Pr;#Lr;#Er;#Ar;#Or;#Nr;#Fr;#Br;#Dr;#Ur;#Hr;#qr;#Tr;#_r;#zr;constructor(t){super(t),this.#Tr=!1,this.#Dr=null,this.#Ur=null,this.#Mr=t.model(Pn),this.#Ar=new Jt(t),this.agent=t.cssAgent(),this.#Or=new an(this),this.#Er=t.model(jn),this.#Er&&this.#Er.addEventListener(_n.PrimaryPageChanged,this.onPrimaryPageChanged,this),t.registerCSSDispatcher(new sn(this)),t.suspended()||this.enable(),this.#Br=new Map,this.#Fr=new Map,this.#Lr=new Map,this.#_r=!1,this.#Pr=new Map,this.#Hr=null,this.#qr=!1,this.#zr=!1,this.#Nr=new e.Throttler.Throttler(dn),this.#Ar.setEnabled(e.Settings.Settings.instance().moduleSetting("cssSourceMapsEnabled").get()),e.Settings.Settings.instance().moduleSetting("cssSourceMapsEnabled").addChangeListener((e=>this.#Ar.setEnabled(e.data)))}headersForSourceURL(e){const t=[];for(const n of this.getStyleSheetIdsForURL(e)){const e=this.styleSheetHeaderForId(n);e&&t.push(e)}return t}createRawLocationsByURL(e,n,r=0){const s=this.headersForSourceURL(e);s.sort((function(e,t){return e.startLine-t.startLine||e.startColumn-t.startColumn||e.id.localeCompare(t.id)}));const i=t.ArrayUtilities.upperBound(s,void 0,((e,t)=>n-t.startLine||r-t.startColumn));if(!i)return[];const a=[],o=s[i-1];for(let e=i-1;e>=0&&s[e].startLine===o.startLine&&s[e].startColumn===o.startColumn;--e)s[e].containsLocation(n,r)&&a.push(new rn(s[e],n,r));return a}sourceMapManager(){return this.#Ar}static readableLayerName(e){return e||"<anonymous>"}static trimSourceURL(e){let t=e.lastIndexOf("/*# sourceURL=");if(-1===t&&(t=e.lastIndexOf("/*@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;const r=e.substr(n+1).split("\n",1)[0];return-1===r.search(/[\040\t]*\/\*[#@] sourceURL=[\040\t]*([^\s]*)[\040\t]*\*\/[\040\t]*$/)?e:e.substr(0,n)+e.substr(n+r.length+1)}domModel(){return this.#Mr}async setStyleText(e,t,n,r){try{await this.ensureOriginalStyleSheetText(e);const{styles:s}=await this.agent.invoke_setStyleTexts({edits:[{styleSheetId:e,range:t.serializeToObject(),text:n}]});if(!s||1!==s.length)return!1;this.#Mr.markUndoableState(!r);const i=new nn(e,t,n,s[0]);return this.fireStyleSheetChanged(e,i),!0}catch(e){return!1}}async setSelectorText(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{selectorList:r}=await this.agent.invoke_setRuleSelector({styleSheetId:e,range:t,selector:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return!1}}async setKeyframeKey(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{keyText:r}=await this.agent.invoke_setKeyframeKey({styleSheetId:e,range:t,keyText:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return!1}}startCoverage(){return this.#_r=!0,this.agent.invoke_startRuleUsageTracking()}async takeCoverageDelta(){const e=await this.agent.invoke_takeCoverageDelta();return{timestamp:e&&e.timestamp||0,coverage:e&&e.coverage||[]}}setLocalFontsEnabled(e){return this.agent.invoke_setLocalFontsEnabled({enabled:e})}async stopCoverage(){this.#_r=!1,await this.agent.invoke_stopRuleUsageTracking()}async getMediaQueries(){const{medias:e}=await this.agent.invoke_getMediaQueries();return e?et.parseMediaArrayPayload(this,e):[]}async getRootLayer(e){const{rootLayer:t}=await this.agent.invoke_getLayersForNode({nodeId:e});return t}isEnabled(){return this.#Tr}async enable(){await this.agent.invoke_enable(),this.#Tr=!0,this.#_r&&await this.startCoverage(),this.dispatchEventToListeners(Yt.ModelWasEnabled)}async getMatchedStyles(e){const t=await this.agent.invoke_getMatchedStylesForNode({nodeId:e});if(t.getError())return null;const n=this.#Mr.nodeForId(e);return n?new It({cssModel:this,node:n,inlinePayload:t.inlineStyle||null,attributesPayload:t.attributesStyle||null,matchedPayload:t.matchedCSSRules||[],pseudoPayload:t.pseudoElements||[],inheritedPayload:t.inherited||[],inheritedPseudoPayload:t.inheritedPseudoElements||[],animationsPayload:t.cssKeyframesRules||[],parentLayoutNodeId:t.parentLayoutNodeId,positionFallbackRules:t.cssPositionFallbackRules||[]}):null}async getClassNames(e){const{classNames:t}=await this.agent.invoke_collectClassNames({styleSheetId:e});return t||[]}async getComputedStyle(e){return this.isEnabled()||await this.enable(),this.#Or.computedStylePromise(e)}async getBackgroundColors(e){const t=await this.agent.invoke_getBackgroundColors({nodeId:e});return t.getError()?null:{backgroundColors:t.backgroundColors||null,computedFontSize:t.computedFontSize||"",computedFontWeight:t.computedFontWeight||""}}async getPlatformFonts(e){const{fonts:t}=await this.agent.invoke_getPlatformFontsForNode({nodeId:e});return t}allStyleSheets(){const e=[...this.#Br.values()];return e.sort((function(e,t){return e.sourceURL<t.sourceURL?-1:e.sourceURL>t.sourceURL?1:e.startLine-t.startLine||e.startColumn-t.startColumn})),e}async getInlineStyles(e){const t=await this.agent.invoke_getInlineStylesForNode({nodeId:e});if(t.getError()||!t.inlineStyle)return null;const n=new dt(this,null,t.inlineStyle,ot.Inline),r=t.attributesStyle?new dt(this,null,t.attributesStyle,ot.Attributes):null;return new on(n,r)}forcePseudoState(e,n,r){const s=e.marker(tn)||[],i=s.includes(n);if(r){if(i)return!1;s.push(n),e.setMarker(tn,s)}else{if(!i)return!1;t.ArrayUtilities.removeElement(s,n),s.length?e.setMarker(tn,s):e.setMarker(tn,null)}return void 0!==e.id&&(this.agent.invoke_forcePseudoState({nodeId:e.id,forcedPseudoClasses:s}),this.dispatchEventToListeners(Yt.PseudoStateForced,{node:e,pseudoClass:n,enable:r}),!0)}pseudoState(e){return e.marker(tn)||[]}async setMediaText(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{media:r}=await this.agent.invoke_setMediaText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return!1}}async setContainerQueryText(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{containerQuery:r}=await this.agent.invoke_setContainerQueryText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return!1}}async setSupportsText(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{supports:r}=await this.agent.invoke_setSupportsText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return!1}}async setScopeText(e,t,n){i.userMetrics.actionTaken(i.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{scope:r}=await this.agent.invoke_setScopeText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Mr.markUndoableState();const s=new nn(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async addRule(e,t,n){try{await this.ensureOriginalStyleSheetText(e);const{rule:r}=await this.agent.invoke_addRule({styleSheetId:e,ruleText:t,location:n});if(!r)return null;this.#Mr.markUndoableState();const s=new nn(e,n,t,r);return this.fireStyleSheetChanged(e,s),new gt(this,r)}catch(e){return null}}async requestViaInspectorStylesheet(e){const t=e.frameId()||(this.#Er&&this.#Er.mainFrame?this.#Er.mainFrame.id:null),n=[...this.#Br.values()].find((e=>e.frameId===t&&e.isViaInspector()));if(n)return n;if(!t)return null;try{const{styleSheetId:e}=await this.agent.invoke_createStyleSheet({frameId:t});return e&&this.#Br.get(e)||null}catch(e){return null}}mediaQueryResultChanged(){this.dispatchEventToListeners(Yt.MediaQueryResultChanged)}fontsUpdated(e){e&&this.#Pr.set(e.src,new _e(e)),this.dispatchEventToListeners(Yt.FontsUpdated)}fontFaces(){return[...this.#Pr.values()]}fontFaceForSource(e){return this.#Pr.get(e)}styleSheetHeaderForId(e){return this.#Br.get(e)||null}styleSheetHeaders(){return[...this.#Br.values()]}fireStyleSheetChanged(e,t){this.dispatchEventToListeners(Yt.StyleSheetChanged,{styleSheetId:e,edit:t})}ensureOriginalStyleSheetText(e){const t=this.styleSheetHeaderForId(e);if(!t)return Promise.resolve(null);let n=this.#Lr.get(t);return n||(n=this.getStyleSheetText(t.id),this.#Lr.set(t,n),this.originalContentRequestedForTest(t)),n}originalContentRequestedForTest(e){}originalStyleSheetText(e){return this.ensureOriginalStyleSheetText(e.id)}getAllStyleSheetHeaders(){return this.#Br.values()}styleSheetAdded(e){console.assert(!this.#Br.get(e.styleSheetId)),e.loadingFailed&&(e.hasSourceURL=!1,e.isConstructed=!0,e.isInline=!1,e.isMutable=!1,e.sourceURL="",e.sourceMapURL=void 0);const t=new xt(this,e);this.#Br.set(e.styleSheetId,t);const n=t.resourceURL();let r=this.#Fr.get(n);if(r||(r=new Map,this.#Fr.set(n,r)),r){let e=r.get(t.frameId);e||(e=new Set,r.set(t.frameId,e)),e.add(t.id)}this.#Ar.attachSourceMap(t,t.sourceURL,t.sourceMapURL),this.dispatchEventToListeners(Yt.StyleSheetAdded,t)}styleSheetRemoved(e){const t=this.#Br.get(e);if(console.assert(Boolean(t)),!t)return;this.#Br.delete(e);const n=t.resourceURL(),r=this.#Fr.get(n);if(console.assert(Boolean(r),"No frameId to styleSheetId map is available for given style sheet URL."),r){const s=r.get(t.frameId);s&&(s.delete(e),s.size||(r.delete(t.frameId),r.size||this.#Fr.delete(n)))}this.#Lr.delete(t),this.#Ar.detachSourceMap(t),this.dispatchEventToListeners(Yt.StyleSheetRemoved,t)}getStyleSheetIdsForURL(e){const t=this.#Fr.get(e);if(!t)return[];const n=[];for(const e of t.values())n.push(...e);return n}async setStyleSheetText(e,t,n){const r=this.#Br.get(e);if(!r)return"Unknown stylesheet in CSS.setStyleSheetText";t=en.trimSourceURL(t),r.hasSourceURL&&(t+="\n/*# sourceURL="+r.sourceURL+" */"),await this.ensureOriginalStyleSheetText(e);const s=(await this.agent.invoke_setStyleSheetText({styleSheetId:r.id,text:t})).sourceMapURL;return this.#Ar.detachSourceMap(r),r.setSourceMapURL(s),this.#Ar.attachSourceMap(r,r.sourceURL,r.sourceMapURL),null===s?"Error in CSS.setStyleSheetText":(this.#Mr.markUndoableState(!n),this.fireStyleSheetChanged(e),null)}async getStyleSheetText(e){try{const{text:t}=await this.agent.invoke_getStyleSheetText({styleSheetId:e});return t&&en.trimSourceURL(t)}catch(e){return null}}async onPrimaryPageChanged(e){e.data.frame.backForwardCacheDetails.restoredFromCache?(await this.suspendModel(),await this.resumeModel()):(this.resetStyleSheets(),this.resetFontFaces())}resetStyleSheets(){const e=[...this.#Br.values()];this.#Fr.clear(),this.#Br.clear();for(const t of e)this.#Ar.detachSourceMap(t),this.dispatchEventToListeners(Yt.StyleSheetRemoved,t)}resetFontFaces(){this.#Pr.clear()}async suspendModel(){this.#Tr=!1,await this.agent.invoke_disable(),this.resetStyleSheets(),this.resetFontFaces()}async resumeModel(){return this.enable()}setEffectivePropertyValueForNode(e,t,n){this.agent.invoke_setEffectivePropertyValueForNode({nodeId:e,propertyName:t,value:n})}cachedMatchedCascadeForNode(e){if(this.#Dr!==e&&this.discardCachedMatchedCascade(),this.#Dr=e,!this.#Ur){if(!e.id)return Promise.resolve(null);this.#Ur=this.getMatchedStyles(e.id)}return this.#Ur}discardCachedMatchedCascade(){this.#Dr=null,this.#Ur=null}createCSSPropertyTracker(e){return new ln(this,e)}enableCSSPropertyTracker(e){const t=e.getTrackedProperties();0!==t.length&&(this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:t}),this.#qr=!0,this.#Hr=e,this.pollComputedStyleUpdates())}disableCSSPropertyTracker(){this.#qr=!1,this.#Hr=null,this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:[]})}async pollComputedStyleUpdates(){if(!this.#zr){if(this.#qr){this.#zr=!0;const e=await this.agent.invoke_takeComputedStyleUpdates();if(this.#zr=!1,e.getError()||!e.nodeIds||!this.#qr)return;this.#Hr&&this.#Hr.dispatchEventToListeners(cn.TrackedCSSPropertiesUpdated,e.nodeIds.map((e=>this.#Mr.nodeForId(e))))}this.#qr&&this.#Nr.schedule(this.pollComputedStyleUpdates.bind(this))}}dispose(){this.disableCSSPropertyTracker(),super.dispose(),this.#Ar.dispose()}getAgent(){return this.agent}}!function(e){e.FontsUpdated="FontsUpdated",e.MediaQueryResultChanged="MediaQueryResultChanged",e.ModelWasEnabled="ModelWasEnabled",e.PseudoStateForced="PseudoStateForced",e.StyleSheetAdded="StyleSheetAdded",e.StyleSheetChanged="StyleSheetChanged",e.StyleSheetRemoved="StyleSheetRemoved"}(Yt||(Yt={}));const tn="pseudo-state-marker";class nn{styleSheetId;oldRange;newRange;newText;payload;constructor(e,t,n,s){this.styleSheetId=e,this.oldRange=t,this.newRange=r.TextRange.TextRange.fromEdit(t,n),this.newText=n,this.payload=s}}class rn{#Sn;styleSheetId;url;lineNumber;columnNumber;constructor(e,t,n){this.#Sn=e.cssModel(),this.styleSheetId=e.id,this.url=e.resourceURL(),this.lineNumber=t,this.columnNumber=n||0}cssModel(){return this.#Sn}header(){return this.#Sn.styleSheetHeaderForId(this.styleSheetId)}}class sn{#jr;constructor(e){this.#jr=e}mediaQueryResultChanged(){this.#jr.mediaQueryResultChanged()}fontsUpdated({font:e}){this.#jr.fontsUpdated(e)}styleSheetChanged({styleSheetId:e}){this.#jr.fireStyleSheetChanged(e)}styleSheetAdded({header:e}){this.#jr.styleSheetAdded(e)}styleSheetRemoved({styleSheetId:e}){this.#jr.styleSheetRemoved(e)}}class an{#jr;#Wr;constructor(e){this.#jr=e,this.#Wr=new Map}computedStylePromise(e){let t=this.#Wr.get(e);return t||(t=this.#jr.getAgent().invoke_getComputedStyleForNode({nodeId:e}).then((({computedStyle:t})=>{if(this.#Wr.delete(e),!t||!t.length)return null;const n=new Map;for(const e of t)n.set(e.name,e.value);return n})),this.#Wr.set(e,t),t)}}class on{inlineStyle;attributesStyle;constructor(e,t){this.inlineStyle=e,this.attributesStyle=t}}class ln extends e.ObjectWrapper.ObjectWrapper{#jr;#Vr;constructor(e,t){super(),this.#jr=e,this.#Vr=t}start(){this.#jr.enableCSSPropertyTracker(this)}stop(){this.#jr.disableCSSPropertyTracker()}getTrackedProperties(){return this.#Vr}}const dn=1e3;var cn;!function(e){e.TrackedCSSPropertiesUpdated="TrackedCSSPropertiesUpdated"}(cn||(cn={})),c.register(en,{capabilities:z.DOM,autostart:!0});var hn=Object.freeze({__proto__:null,CSSModel:en,get Events(){return Yt},Edit:nn,CSSLocation:rn,InlineStyleResult:on,CSSPropertyTracker:ln,get CSSPropertyTrackerEvents(){return cn}});class un{#Gr;#Kr;constructor(){const t="rgba";this.#Gr=[new e.Color.Legacy([.9607843137254902,.592156862745098,.5803921568627451,1],t),new e.Color.Legacy([.9411764705882353,.7490196078431373,.2980392156862745,1],t),new e.Color.Legacy([.8313725490196079,.9294117647058824,.19215686274509805,1],t),new e.Color.Legacy([.6196078431372549,.9215686274509803,.2784313725490196,1],t),new e.Color.Legacy([.3568627450980392,.8196078431372549,.8431372549019608,1],t),new e.Color.Legacy([.7372549019607844,.807843137254902,.984313725490196,1],t),new e.Color.Legacy([.7764705882352941,.7450980392156863,.9333333333333333,1],t),new e.Color.Legacy([.8156862745098039,.5803921568627451,.9176470588235294,1],t),new e.Color.Legacy([.9215686274509803,.5803921568627451,.8117647058823529,1],t)],this.#Kr=0}next(){const e=this.#Gr[this.#Kr];return this.#Kr++,this.#Kr>=this.#Gr.length&&(this.#Kr=0),e}}var gn=Object.freeze({__proto__:null,OverlayColorGenerator:un});class pn{#$r;#Qr;#Xr;#Jr;#Yr;#Zr;#Gr;#es;#ts;#ns;#rs;#ss;#is;#as;constructor(t,n=!0){this.#$r=t,this.#Qr=new Map,this.#Xr=new Map,this.#Jr=new Map,this.#Yr=new Map,this.#Zr=new Map,this.#Gr=new Map,this.#es=new un,this.#ts=new un,this.#ns=n,this.#rs=e.Settings.Settings.instance().moduleSetting("showGridLineLabels"),this.#rs.addChangeListener(this.onSettingChange,this),this.#ss=e.Settings.Settings.instance().moduleSetting("extendGridLines"),this.#ss.addChangeListener(this.onSettingChange,this),this.#is=e.Settings.Settings.instance().moduleSetting("showGridAreas"),this.#is.addChangeListener(this.onSettingChange,this),this.#as=e.Settings.Settings.instance().moduleSetting("showGridTrackSizes"),this.#as.addChangeListener(this.onSettingChange,this)}onSettingChange(){this.resetOverlay()}buildGridHighlightConfig(e){const t=this.colorOfGrid(e).asLegacyColor(),n=t.setAlpha(.1).asLegacyColor(),r=t.setAlpha(.3).asLegacyColor(),s=t.setAlpha(.8).asLegacyColor(),i=this.#ss.get(),a="lineNumbers"===this.#rs.get(),o=a,l="lineNames"===this.#rs.get();return{rowGapColor:r.toProtocolRGBA(),rowHatchColor:s.toProtocolRGBA(),columnGapColor:r.toProtocolRGBA(),columnHatchColor:s.toProtocolRGBA(),gridBorderColor:t.toProtocolRGBA(),gridBorderDash:!1,rowLineColor:t.toProtocolRGBA(),columnLineColor:t.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showGridExtensionLines:i,showPositiveLineNumbers:a,showNegativeLineNumbers:o,showLineNames:l,showAreaNames:this.#is.get(),showTrackSizes:this.#as.get(),areaBorderColor:t.toProtocolRGBA(),gridBackgroundColor:n.toProtocolRGBA()}}buildFlexContainerHighlightConfig(e){const t=this.colorOfFlex(e).asLegacyColor();return{containerBorder:{color:t.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:t.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:t.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:t.toProtocolRGBA()},crossDistributedSpace:{hatchColor:t.toProtocolRGBA()}}}buildScrollSnapContainerHighlightConfig(t){return{snapAreaBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),pattern:"dashed"},snapportBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA()},scrollMarginColor:e.Color.PageHighlight.Margin.toProtocolRGBA(),scrollPaddingColor:e.Color.PageHighlight.Padding.toProtocolRGBA()}}highlightGridInOverlay(e){this.#Qr.set(e,this.buildGridHighlightConfig(e)),this.updateHighlightsInOverlay()}isGridHighlighted(e){return this.#Qr.has(e)}colorOfGrid(e){let t=this.#Gr.get(e);return t||(t=this.#es.next(),this.#Gr.set(e,t)),t}setColorOfGrid(e,t){this.#Gr.set(e,t)}hideGridInOverlay(e){this.#Qr.has(e)&&(this.#Qr.delete(e),this.updateHighlightsInOverlay())}highlightScrollSnapInOverlay(e){this.#Xr.set(e,this.buildScrollSnapContainerHighlightConfig(e)),this.updateHighlightsInOverlay()}isScrollSnapHighlighted(e){return this.#Xr.has(e)}hideScrollSnapInOverlay(e){this.#Xr.has(e)&&(this.#Xr.delete(e),this.updateHighlightsInOverlay())}highlightFlexInOverlay(e){this.#Jr.set(e,this.buildFlexContainerHighlightConfig(e)),this.updateHighlightsInOverlay()}isFlexHighlighted(e){return this.#Jr.has(e)}colorOfFlex(e){let t=this.#Gr.get(e);return t||(t=this.#ts.next(),this.#Gr.set(e,t)),t}setColorOfFlex(e,t){this.#Gr.set(e,t)}hideFlexInOverlay(e){this.#Jr.has(e)&&(this.#Jr.delete(e),this.updateHighlightsInOverlay())}highlightContainerQueryInOverlay(e){this.#Yr.set(e,this.buildContainerQueryContainerHighlightConfig()),this.updateHighlightsInOverlay()}hideContainerQueryInOverlay(e){this.#Yr.has(e)&&(this.#Yr.delete(e),this.updateHighlightsInOverlay())}isContainerQueryHighlighted(e){return this.#Yr.has(e)}buildContainerQueryContainerHighlightConfig(){return{containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},descendantBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}}highlightIsolatedElementInOverlay(e){this.#Zr.set(e,this.buildIsolationModeHighlightConfig()),this.updateHighlightsInOverlay()}hideIsolatedElementInOverlay(e){this.#Zr.has(e)&&(this.#Zr.delete(e),this.updateHighlightsInOverlay())}isIsolatedElementHighlighted(e){return this.#Zr.has(e)}buildIsolationModeHighlightConfig(){return{resizerColor:e.Color.IsolationModeHighlight.Resizer.toProtocolRGBA(),resizerHandleColor:e.Color.IsolationModeHighlight.ResizerHandle.toProtocolRGBA(),maskColor:e.Color.IsolationModeHighlight.Mask.toProtocolRGBA()}}hideAllInOverlay(){this.#Jr.clear(),this.#Qr.clear(),this.#Xr.clear(),this.#Yr.clear(),this.#Zr.clear(),this.updateHighlightsInOverlay()}refreshHighlights(){const e=this.updateHighlightsForDeletedNodes(this.#Qr),t=this.updateHighlightsForDeletedNodes(this.#Jr),n=this.updateHighlightsForDeletedNodes(this.#Xr),r=this.updateHighlightsForDeletedNodes(this.#Yr),s=this.updateHighlightsForDeletedNodes(this.#Zr);(t||e||n||r||s)&&this.updateHighlightsInOverlay()}updateHighlightsForDeletedNodes(e){let t=!1;for(const n of e.keys())null===this.#$r.getDOMModel().nodeForId(n)&&(e.delete(n),t=!0);return t}resetOverlay(){for(const e of this.#Qr.keys())this.#Qr.set(e,this.buildGridHighlightConfig(e));for(const e of this.#Jr.keys())this.#Jr.set(e,this.buildFlexContainerHighlightConfig(e));for(const e of this.#Xr.keys())this.#Xr.set(e,this.buildScrollSnapContainerHighlightConfig(e));for(const e of this.#Yr.keys())this.#Yr.set(e,this.buildContainerQueryContainerHighlightConfig());for(const e of this.#Zr.keys())this.#Zr.set(e,this.buildIsolationModeHighlightConfig());this.updateHighlightsInOverlay()}updateHighlightsInOverlay(){const e=this.#Qr.size>0||this.#Jr.size>0||this.#Yr.size>0||this.#Zr.size>0;this.#$r.setShowViewportSizeOnResize(!e),this.updateGridHighlightsInOverlay(),this.updateFlexHighlightsInOverlay(),this.updateScrollSnapHighlightsInOverlay(),this.updateContainerQueryHighlightsInOverlay(),this.updateIsolatedElementHighlightsInOverlay()}updateGridHighlightsInOverlay(){const e=this.#$r,t=[];for(const[e,n]of this.#Qr.entries())t.push({nodeId:e,gridHighlightConfig:n});e.target().overlayAgent().invoke_setShowGridOverlays({gridNodeHighlightConfigs:t})}updateFlexHighlightsInOverlay(){if(!this.#ns)return;const e=this.#$r,t=[];for(const[e,n]of this.#Jr.entries())t.push({nodeId:e,flexContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowFlexOverlays({flexNodeHighlightConfigs:t})}updateScrollSnapHighlightsInOverlay(){const e=this.#$r,t=[];for(const[e,n]of this.#Xr.entries())t.push({nodeId:e,scrollSnapContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowScrollSnapOverlays({scrollSnapHighlightConfigs:t})}updateContainerQueryHighlightsInOverlay(){const e=this.#$r,t=[];for(const[e,n]of this.#Yr.entries())t.push({nodeId:e,containerQueryContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowContainerQueryOverlays({containerQueryHighlightConfigs:t})}updateIsolatedElementHighlightsInOverlay(){const e=this.#$r,t=[];for(const[e,n]of this.#Zr.entries())t.push({nodeId:e,isolationModeHighlightConfig:n});e.target().overlayAgent().invoke_setShowIsolatedElements({isolatedElementHighlightConfigs:t})}}var mn=Object.freeze({__proto__:null,OverlayPersistentHighlighter:pn});const fn={pausedInDebugger:"Paused in debugger"},bn=s.i18n.registerUIStrings("core/sdk/OverlayModel.ts",fn),yn=s.i18n.getLocalizedString.bind(void 0,bn);class vn extends c{#Mr;overlayAgent;#os;#ls;#ds;#cs;#hs;#us;#gs;#ps;#ms;#fs;#bs;#ys;#vs;#Is;#ks;#Ss;#ws;constructor(t){super(t),this.#Mr=t.model(Pn),t.registerOverlayDispatcher(this),this.overlayAgent=t.overlayAgent(),this.#os=t.model(or),this.#os&&(e.Settings.Settings.instance().moduleSetting("disablePausedStateOverlay").addChangeListener(this.updatePausedInDebuggerMessage,this),this.#os.addEventListener(cr.DebuggerPaused,this.updatePausedInDebuggerMessage,this),this.#os.addEventListener(cr.DebuggerResumed,this.updatePausedInDebuggerMessage,this),this.#os.addEventListener(cr.GlobalObjectCleared,this.updatePausedInDebuggerMessage,this)),this.#ls=!1,this.#ds=null,this.#cs=new kn(this),this.#hs=this.#cs,this.#us=e.Settings.Settings.instance().moduleSetting("showPaintRects"),this.#gs=e.Settings.Settings.instance().moduleSetting("showLayoutShiftRegions"),this.#ps=e.Settings.Settings.instance().moduleSetting("showAdHighlights"),this.#ms=e.Settings.Settings.instance().moduleSetting("showDebugBorders"),this.#fs=e.Settings.Settings.instance().moduleSetting("showFPSCounter"),this.#bs=e.Settings.Settings.instance().moduleSetting("showScrollBottleneckRects"),this.#ys=e.Settings.Settings.instance().moduleSetting("showWebVitals"),this.#vs=[],this.#Is=!0,t.suspended()||(this.overlayAgent.invoke_enable(),this.wireAgentToSettings()),this.#ks=new pn(this),this.#Mr.addEventListener(wn.NodeRemoved,(()=>{this.#ks&&this.#ks.refreshHighlights()})),this.#Mr.addEventListener(wn.DocumentUpdated,(()=>{this.#ks&&this.#ks.hideAllInOverlay()})),this.#Ss=new Sn(this),this.#ws=!1}static highlightObjectAsDOMNode(e){const t=e.runtimeModel().target().model(Pn);t&&t.overlayModel().highlightInOverlay({object:e,selectorList:void 0})}static hideDOMNodeHighlight(){for(const e of K.instance().models(vn))e.delayedHideHighlight(0)}static async muteHighlight(){return Promise.all(K.instance().models(vn).map((e=>e.suspendModel())))}static async unmuteHighlight(){return Promise.all(K.instance().models(vn).map((e=>e.resumeModel())))}static highlightRect(e){for(const t of K.instance().models(vn))t.highlightRect(e)}static clearHighlight(){for(const e of K.instance().models(vn))e.clearHighlight()}getDOMModel(){return this.#Mr}highlightRect({x:e,y:t,width:n,height:r,color:s,outlineColor:i}){const a=s||{r:255,g:0,b:255,a:.3},o=i||{r:255,g:0,b:255,a:.5};return this.overlayAgent.invoke_highlightRect({x:e,y:t,width:n,height:r,color:a,outlineColor:o})}clearHighlight(){return this.overlayAgent.invoke_hideHighlight()}async wireAgentToSettings(){this.#vs=[this.#us.addChangeListener((()=>this.overlayAgent.invoke_setShowPaintRects({result:this.#us.get()}))),this.#gs.addChangeListener((()=>this.overlayAgent.invoke_setShowLayoutShiftRegions({result:this.#gs.get()}))),this.#ps.addChangeListener((()=>this.overlayAgent.invoke_setShowAdHighlights({show:this.#ps.get()}))),this.#ms.addChangeListener((()=>this.overlayAgent.invoke_setShowDebugBorders({show:this.#ms.get()}))),this.#fs.addChangeListener((()=>this.overlayAgent.invoke_setShowFPSCounter({show:this.#fs.get()}))),this.#bs.addChangeListener((()=>this.overlayAgent.invoke_setShowScrollBottleneckRects({show:this.#bs.get()}))),this.#ys.addChangeListener((()=>this.overlayAgent.invoke_setShowWebVitals({show:this.#ys.get()})))],this.#us.get()&&this.overlayAgent.invoke_setShowPaintRects({result:!0}),this.#gs.get()&&this.overlayAgent.invoke_setShowLayoutShiftRegions({result:!0}),this.#ps.get()&&this.overlayAgent.invoke_setShowAdHighlights({show:!0}),this.#ms.get()&&this.overlayAgent.invoke_setShowDebugBorders({show:!0}),this.#fs.get()&&this.overlayAgent.invoke_setShowFPSCounter({show:!0}),this.#bs.get()&&this.overlayAgent.invoke_setShowScrollBottleneckRects({show:!0}),this.#ys.get()&&this.overlayAgent.invoke_setShowWebVitals({show:!0}),this.#os&&this.#os.isPaused()&&this.updatePausedInDebuggerMessage(),await this.overlayAgent.invoke_setShowViewportSizeOnResize({show:this.#Is})}async suspendModel(){e.EventTarget.removeEventListeners(this.#vs),await this.overlayAgent.invoke_disable()}async resumeModel(){await Promise.all([this.overlayAgent.invoke_enable(),this.wireAgentToSettings()])}setShowViewportSizeOnResize(e){this.#Is!==e&&(this.#Is=e,this.target().suspended()||this.overlayAgent.invoke_setShowViewportSizeOnResize({show:e}))}updatePausedInDebuggerMessage(){if(this.target().suspended())return;const t=this.#os&&this.#os.isPaused()&&!e.Settings.Settings.instance().moduleSetting("disablePausedStateOverlay").get()?yn(fn.pausedInDebugger):void 0;this.overlayAgent.invoke_setPausedInDebuggerMessage({message:t})}setHighlighter(e){this.#hs=e||this.#cs}async setInspectMode(e,t=!0){await this.#Mr.requestDocument(),this.#ls="none"!==e,this.dispatchEventToListeners(In.InspectModeWillBeToggled,this),this.#hs.setInspectMode(e,this.buildHighlightConfig("all",t))}inspectModeEnabled(){return this.#ls}highlightInOverlay(e,t,n){if(this.#ws)return;this.#ds&&(clearTimeout(this.#ds),this.#ds=null);const r=this.buildHighlightConfig(t);void 0!==n&&(r.showInfo=n),this.#hs.highlightInOverlay(e,r)}highlightInOverlayForTwoSeconds(e){this.highlightInOverlay(e),this.delayedHideHighlight(2e3)}highlightGridInPersistentOverlay(e){this.#ks&&(this.#ks.highlightGridInOverlay(e),this.dispatchEventToListeners(In.PersistentGridOverlayStateChanged,{nodeId:e,enabled:!0}))}isHighlightedGridInPersistentOverlay(e){return!!this.#ks&&this.#ks.isGridHighlighted(e)}hideGridInPersistentOverlay(e){this.#ks&&(this.#ks.hideGridInOverlay(e),this.dispatchEventToListeners(In.PersistentGridOverlayStateChanged,{nodeId:e,enabled:!1}))}highlightScrollSnapInPersistentOverlay(e){this.#ks&&(this.#ks.highlightScrollSnapInOverlay(e),this.dispatchEventToListeners(In.PersistentScrollSnapOverlayStateChanged,{nodeId:e,enabled:!0}))}isHighlightedScrollSnapInPersistentOverlay(e){return!!this.#ks&&this.#ks.isScrollSnapHighlighted(e)}hideScrollSnapInPersistentOverlay(e){this.#ks&&(this.#ks.hideScrollSnapInOverlay(e),this.dispatchEventToListeners(In.PersistentScrollSnapOverlayStateChanged,{nodeId:e,enabled:!1}))}highlightFlexContainerInPersistentOverlay(e){this.#ks&&(this.#ks.highlightFlexInOverlay(e),this.dispatchEventToListeners(In.PersistentFlexContainerOverlayStateChanged,{nodeId:e,enabled:!0}))}isHighlightedFlexContainerInPersistentOverlay(e){return!!this.#ks&&this.#ks.isFlexHighlighted(e)}hideFlexContainerInPersistentOverlay(e){this.#ks&&(this.#ks.hideFlexInOverlay(e),this.dispatchEventToListeners(In.PersistentFlexContainerOverlayStateChanged,{nodeId:e,enabled:!1}))}highlightContainerQueryInPersistentOverlay(e){this.#ks&&(this.#ks.highlightContainerQueryInOverlay(e),this.dispatchEventToListeners(In.PersistentContainerQueryOverlayStateChanged,{nodeId:e,enabled:!0}))}isHighlightedContainerQueryInPersistentOverlay(e){return!!this.#ks&&this.#ks.isContainerQueryHighlighted(e)}hideContainerQueryInPersistentOverlay(e){this.#ks&&(this.#ks.hideContainerQueryInOverlay(e),this.dispatchEventToListeners(In.PersistentContainerQueryOverlayStateChanged,{nodeId:e,enabled:!1}))}highlightSourceOrderInOverlay(t){const n={parentOutlineColor:e.Color.SourceOrderHighlight.ParentOutline.toProtocolRGBA(),childOutlineColor:e.Color.SourceOrderHighlight.ChildOutline.toProtocolRGBA()};this.#Ss.highlightSourceOrderInOverlay(t,n)}colorOfGridInPersistentOverlay(e){return this.#ks?this.#ks.colorOfGrid(e).asString("hex"):null}setColorOfGridInPersistentOverlay(t,n){if(!this.#ks)return;const r=e.Color.parse(n);r&&(this.#ks.setColorOfGrid(t,r),this.#ks.resetOverlay())}colorOfFlexInPersistentOverlay(e){return this.#ks?this.#ks.colorOfFlex(e).asString("hex"):null}setColorOfFlexInPersistentOverlay(t,n){if(!this.#ks)return;const r=e.Color.parse(n);r&&(this.#ks.setColorOfFlex(t,r),this.#ks.resetOverlay())}hideSourceOrderInOverlay(){this.#Ss.hideSourceOrderHighlight()}setSourceOrderActive(e){this.#ws=e}sourceOrderModeActive(){return this.#ws}highlightIsolatedElementInPersistentOverlay(e){this.#ks&&this.#ks.highlightIsolatedElementInOverlay(e)}hideIsolatedElementInPersistentOverlay(e){this.#ks&&this.#ks.hideIsolatedElementInOverlay(e)}isHighlightedIsolatedElementInPersistentOverlay(e){return!!this.#ks&&this.#ks.isIsolatedElementHighlighted(e)}delayedHideHighlight(e){null===this.#ds&&(this.#ds=window.setTimeout((()=>this.highlightInOverlay({clear:!0})),e))}highlightFrame(e){this.#ds&&(clearTimeout(this.#ds),this.#ds=null),this.#hs.highlightFrame(e)}showHingeForDualScreen(e){if(e){const{x:t,y:n,width:r,height:s,contentColor:i,outlineColor:a}=e;this.overlayAgent.invoke_setShowHinge({hingeConfig:{rect:{x:t,y:n,width:r,height:s},contentColor:i,outlineColor:a}})}else this.overlayAgent.invoke_setShowHinge({})}buildHighlightConfig(t="all",n=!1){const r=e.Settings.Settings.instance().moduleSetting("showMetricsRulers").get(),s=e.Settings.Settings.instance().moduleSetting("colorFormat").get(),i={showInfo:"all"===t||"container-outline"===t,showRulers:r,showStyles:n,showAccessibilityInfo:n,showExtensionLines:r,gridHighlightConfig:{},flexContainerHighlightConfig:{},flexItemHighlightConfig:{},contrastAlgorithm:o.Runtime.experiments.isEnabled("APCA")?"apca":"aa"};"all"!==t&&"content"!==t||(i.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA()),"all"!==t&&"padding"!==t||(i.paddingColor=e.Color.PageHighlight.Padding.toProtocolRGBA()),"all"!==t&&"border"!==t||(i.borderColor=e.Color.PageHighlight.Border.toProtocolRGBA()),"all"!==t&&"margin"!==t||(i.marginColor=e.Color.PageHighlight.Margin.toProtocolRGBA()),"all"===t&&(i.eventTargetColor=e.Color.PageHighlight.EventTarget.toProtocolRGBA(),i.shapeColor=e.Color.PageHighlight.Shape.toProtocolRGBA(),i.shapeMarginColor=e.Color.PageHighlight.ShapeMargin.toProtocolRGBA(),i.gridHighlightConfig={rowGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),rowHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),columnGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),columnHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0},i.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},rowGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},columnGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}},i.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),t.endsWith("gap")&&(i.gridHighlightConfig={gridBorderColor:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),gridBorderDash:!0},"gap"!==t&&"row-gap"!==t||(i.gridHighlightConfig.rowGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),i.gridHighlightConfig.rowHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA()),"gap"!==t&&"column-gap"!==t||(i.gridHighlightConfig.columnGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),i.gridHighlightConfig.columnHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA())),t.endsWith("gap")&&(i.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}},"gap"!==t&&"row-gap"!==t||(i.flexContainerHighlightConfig.rowGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}),"gap"!==t&&"column-gap"!==t||(i.flexContainerHighlightConfig.columnGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()})),"grid-areas"===t&&(i.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showAreaNames:!0,areaBorderColor:e.Color.PageHighlight.GridAreaBorder.toProtocolRGBA()}),"grid-template-columns"===t&&(i.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),i.gridHighlightConfig={columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineDash:!0}),"grid-template-rows"===t&&(i.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),i.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0}),"justify-content"===t&&(i.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-content"===t&&(i.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-items"===t&&(i.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossAlignment:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"flexibility"===t&&(i.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"container-outline"===t&&(i.containerQueryContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}});return new Set(["rgb","hsl","hex"]).has(s)&&(i.colorFormat=s),i}nodeHighlightRequested({nodeId:e}){const t=this.#Mr.nodeForId(e);t&&this.dispatchEventToListeners(In.HighlightNodeRequested,t)}static setInspectNodeHandler(e){vn.inspectNodeHandler=e}inspectNodeRequested({backendNodeId:t}){const n=new Rn(this.target(),t);vn.inspectNodeHandler?n.resolvePromise().then((e=>{e&&vn.inspectNodeHandler&&vn.inspectNodeHandler(e)})):e.Revealer.reveal(n),this.dispatchEventToListeners(In.ExitedInspectMode)}screenshotRequested({viewport:e}){this.dispatchEventToListeners(In.ScreenshotRequested,e),this.dispatchEventToListeners(In.ExitedInspectMode)}inspectModeCanceled(){this.dispatchEventToListeners(In.ExitedInspectMode)}static inspectNodeHandler=null;getOverlayAgent(){return this.overlayAgent}}var In;!function(e){e.InspectModeWillBeToggled="InspectModeWillBeToggled",e.ExitedInspectMode="InspectModeExited",e.HighlightNodeRequested="HighlightNodeRequested",e.ScreenshotRequested="ScreenshotRequested",e.PersistentGridOverlayStateChanged="PersistentGridOverlayStateChanged",e.PersistentFlexContainerOverlayStateChanged="PersistentFlexContainerOverlayStateChanged",e.PersistentScrollSnapOverlayStateChanged="PersistentScrollSnapOverlayStateChanged",e.PersistentContainerQueryOverlayStateChanged="PersistentContainerQueryOverlayStateChanged"}(In||(In={}));class kn{#$r;constructor(e){this.#$r=e}highlightInOverlay(e,t){const{node:n,deferredNode:r,object:s,selectorList:i}={node:void 0,deferredNode:void 0,object:void 0,selectorList:void 0,...e},a=n?n.id:void 0,o=r?r.backendNodeId():void 0,l=s?s.objectId:void 0;a||o||l?this.#$r.target().overlayAgent().invoke_highlightNode({highlightConfig:t,nodeId:a,backendNodeId:o,objectId:l,selector:i}):this.#$r.target().overlayAgent().invoke_hideHighlight()}async setInspectMode(e,t){await this.#$r.target().overlayAgent().invoke_setInspectMode({mode:e,highlightConfig:t})}highlightFrame(t){this.#$r.target().overlayAgent().invoke_highlightFrame({frameId:t,contentColor:e.Color.PageHighlight.Content.toProtocolRGBA(),contentOutlineColor:e.Color.PageHighlight.ContentOutline.toProtocolRGBA()})}}class Sn{#$r;constructor(e){this.#$r=e}highlightSourceOrderInOverlay(e,t){this.#$r.setSourceOrderActive(!0),this.#$r.setShowViewportSizeOnResize(!1),this.#$r.getOverlayAgent().invoke_highlightSourceOrder({sourceOrderConfig:t,nodeId:e.id})}hideSourceOrderHighlight(){this.#$r.setSourceOrderActive(!1),this.#$r.setShowViewportSizeOnResize(!0),this.#$r.clearHighlight()}}c.register(vn,{capabilities:z.DOM,autostart:!0});var wn,Cn=Object.freeze({__proto__:null,OverlayModel:vn,get Events(){return In},SourceOrderHighlighter:Sn});class Tn{#Cs;#Ts;ownerDocument;#Rs;id;index;#xs;#Ms;#Ps;#Ls;nodeValueInternal;#Es;#As;#Os;#Ns;#Fs;#Bs;#Ds;#Us;#Hs;assignedSlot;shadowRootsInternal;#qs;#_s;#zs;childNodeCountInternal;childrenInternal;nextSibling;previousSibling;firstChild;lastChild;parentNode;templateContentInternal;contentDocumentInternal;childDocumentPromiseForTesting;#js;publicId;systemId;internalSubset;name;value;constructor(e){this.#Cs=e,this.#Ts=this.#Cs.getAgent(),this.index=void 0,this.#Ds=null,this.#Us=new Map,this.#Hs=[],this.assignedSlot=null,this.shadowRootsInternal=[],this.#qs=new Map,this.#_s=new Map,this.#zs=0,this.childrenInternal=null,this.nextSibling=null,this.previousSibling=null,this.firstChild=null,this.lastChild=null,this.parentNode=null}static create(e,t,n,r){const s=new Tn(e);return s.init(t,n,r),s}init(e,t,n){if(this.#Ts=this.#Cs.getAgent(),this.ownerDocument=e,this.#Rs=t,this.id=n.nodeId,this.#xs=n.backendNodeId,this.#Cs.registerNode(this),this.#Ms=n.nodeType,this.#Ps=n.nodeName,this.#Ls=n.localName,this.nodeValueInternal=n.nodeValue,this.#Es=n.pseudoType,this.#As=n.pseudoIdentifier,this.#Os=n.shadowRootType,this.#Ns=n.frameId||null,this.#Fs=n.xmlVersion,this.#Bs=Boolean(n.isSVG),n.attributes&&this.setAttributesPayload(n.attributes),this.childNodeCountInternal=n.childNodeCount||0,n.shadowRoots)for(let e=0;e<n.shadowRoots.length;++e){const t=n.shadowRoots[e],r=Tn.create(this.#Cs,this.ownerDocument,!0,t);this.shadowRootsInternal.push(r),r.parentNode=this}n.templateContent&&(this.templateContentInternal=Tn.create(this.#Cs,this.ownerDocument,!0,n.templateContent),this.templateContentInternal.parentNode=this,this.childrenInternal=[]);const r=new Set(["EMBED","IFRAME","OBJECT","PORTAL","FENCEDFRAME"]);n.contentDocument?(this.contentDocumentInternal=new Mn(this.#Cs,n.contentDocument),this.contentDocumentInternal.parentNode=this,this.childrenInternal=[]):n.frameId&&r.has(n.nodeName)&&(this.childDocumentPromiseForTesting=this.requestChildDocument(n.frameId,this.#Cs.target()),this.childrenInternal=[]),n.importedDocument&&(this.#js=Tn.create(this.#Cs,this.ownerDocument,!0,n.importedDocument),this.#js.parentNode=this,this.childrenInternal=[]),n.distributedNodes&&this.setDistributedNodePayloads(n.distributedNodes),n.assignedSlot&&this.setAssignedSlot(n.assignedSlot),n.children&&this.setChildrenPayload(n.children),this.setPseudoElements(n.pseudoElements),this.#Ms===Node.ELEMENT_NODE?(this.ownerDocument&&!this.ownerDocument.documentElement&&"HTML"===this.#Ps&&(this.ownerDocument.documentElement=this),this.ownerDocument&&!this.ownerDocument.body&&"BODY"===this.#Ps&&(this.ownerDocument.body=this)):this.#Ms===Node.DOCUMENT_TYPE_NODE?(this.publicId=n.publicId,this.systemId=n.systemId,this.internalSubset=n.internalSubset):this.#Ms===Node.ATTRIBUTE_NODE&&(this.name=n.name,this.value=n.value)}async requestChildDocument(e,t){const n=(await Lt.instance().getOrWaitForFrame(e,t)).resourceTreeModel()?.target().model(Pn);return n?.requestDocument()||null}isAdFrameNode(){if(this.isIframe()&&this.#Ns){const e=Lt.instance().getFrame(this.#Ns);return!!e&&"none"!==e.adFrameType()}return!1}isSVGNode(){return this.#Bs}creationStackTrace(){if(this.#Ds)return this.#Ds;const e=this.#Ts.invoke_getNodeStackTraces({nodeId:this.id});return this.#Ds=e.then((e=>e.creation||null)),this.#Ds}get subtreeMarkerCount(){return this.#zs}domModel(){return this.#Cs}backendNodeId(){return this.#xs}children(){return this.childrenInternal?this.childrenInternal.slice():null}setChildren(e){this.childrenInternal=e}hasAttributes(){return this.#qs.size>0}childNodeCount(){return this.childNodeCountInternal}setChildNodeCount(e){this.childNodeCountInternal=e}hasShadowRoots(){return Boolean(this.shadowRootsInternal.length)}shadowRoots(){return this.shadowRootsInternal.slice()}templateContent(){return this.templateContentInternal||null}contentDocument(){return this.contentDocumentInternal||null}setContentDocument(e){this.contentDocumentInternal=e}isIframe(){return"IFRAME"===this.#Ps}isPortal(){return"PORTAL"===this.#Ps}importedDocument(){return this.#js||null}nodeType(){return this.#Ms}nodeName(){return this.#Ps}pseudoType(){return this.#Es}pseudoIdentifier(){return this.#As}hasPseudoElements(){return this.#Us.size>0}pseudoElements(){return this.#Us}beforePseudoElement(){return this.#Us.get("before")?.at(-1)}afterPseudoElement(){return this.#Us.get("after")?.at(-1)}markerPseudoElement(){return this.#Us.get("marker")?.at(-1)}backdropPseudoElement(){return this.#Us.get("backdrop")?.at(-1)}viewTransitionPseudoElements(){return[...this.#Us.get("view-transition")||[],...this.#Us.get("view-transition-group")||[],...this.#Us.get("view-transition-image-pair")||[],...this.#Us.get("view-transition-old")||[],...this.#Us.get("view-transition-new")||[]]}hasAssignedSlot(){return null!==this.assignedSlot}isInsertionPoint(){return!this.isXMLNode()&&("SHADOW"===this.#Ps||"CONTENT"===this.#Ps||"SLOT"===this.#Ps)}distributedNodes(){return this.#Hs}isInShadowTree(){return this.#Rs}ancestorShadowHost(){const e=this.ancestorShadowRoot();return e?e.parentNode:null}ancestorShadowRoot(){if(!this.#Rs)return null;let e=this;for(;e&&!e.isShadowRoot();)e=e.parentNode;return e}ancestorUserAgentShadowRoot(){const e=this.ancestorShadowRoot();return e&&e.shadowRootType()===Tn.ShadowRootTypes.UserAgent?e:null}isShadowRoot(){return Boolean(this.#Os)}shadowRootType(){return this.#Os||null}nodeNameInCorrectCase(){const e=this.shadowRootType();return e?"#shadow-root ("+e+")":this.localName()?this.localName().length!==this.nodeName().length?this.nodeName():this.localName():this.nodeName()}setNodeName(e,t){this.#Ts.invoke_setNodeName({nodeId:this.id,name:e}).then((e=>{e.getError()||this.#Cs.markUndoableState(),t&&t(e.getError()||null,this.#Cs.nodeForId(e.nodeId))}))}localName(){return this.#Ls}nodeValue(){return this.nodeValueInternal}setNodeValueInternal(e){this.nodeValueInternal=e}setNodeValue(e,t){this.#Ts.invoke_setNodeValue({nodeId:this.id,value:e}).then((e=>{e.getError()||this.#Cs.markUndoableState(),t&&t(e.getError()||null)}))}getAttribute(e){const t=this.#qs.get(e);return t?t.value:void 0}setAttribute(e,t,n){this.#Ts.invoke_setAttributesAsText({nodeId:this.id,text:t,name:e}).then((e=>{e.getError()||this.#Cs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValue(e,t,n){this.#Ts.invoke_setAttributeValue({nodeId:this.id,name:e,value:t}).then((e=>{e.getError()||this.#Cs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValuePromise(e,t){return new Promise((n=>this.setAttributeValue(e,t,n)))}attributes(){return[...this.#qs.values()]}async removeAttribute(e){(await this.#Ts.invoke_removeAttribute({nodeId:this.id,name:e})).getError()||(this.#qs.delete(e),this.#Cs.markUndoableState())}getChildNodes(e){this.childrenInternal?e(this.children()):this.#Ts.invoke_requestChildNodes({nodeId:this.id}).then((t=>{e(t.getError()?null:this.children())}))}async getSubtree(e,t){return(await this.#Ts.invoke_requestChildNodes({nodeId:this.id,depth:e,pierce:t})).getError()?null:this.childrenInternal}async getOuterHTML(){const{outerHTML:e}=await this.#Ts.invoke_getOuterHTML({nodeId:this.id});return e}setOuterHTML(e,t){this.#Ts.invoke_setOuterHTML({nodeId:this.id,outerHTML:e}).then((e=>{e.getError()||this.#Cs.markUndoableState(),t&&t(e.getError()||null)}))}removeNode(e){return this.#Ts.invoke_removeNode({nodeId:this.id}).then((t=>{t.getError()||this.#Cs.markUndoableState(),e&&e(t.getError()||null)}))}async copyNode(){const{outerHTML:e}=await this.#Ts.invoke_getOuterHTML({nodeId:this.id});return null!==e&&i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e),e}path(){function e(e){return(void 0!==e.index||e.isShadowRoot()&&e.parentNode)&&e.#Ps.length}const t=[];let n=this;for(;n&&e(n);){const e="number"==typeof n.index?n.index:n.shadowRootType()===Tn.ShadowRootTypes.UserAgent?"u":"a";t.push([e,n.#Ps]),n=n.parentNode}return t.reverse(),t.join(",")}isAncestor(e){if(!e)return!1;let t=e.parentNode;for(;t;){if(this===t)return!0;t=t.parentNode}return!1}isDescendant(e){return null!==e&&e.isAncestor(this)}frameOwnerFrameId(){return this.#Ns}frameId(){let e=this.parentNode||this;for(;!e.#Ns&&e.parentNode;)e=e.parentNode;return e.#Ns}setAttributesPayload(e){let t=!this.#qs||e.length!==2*this.#qs.size;const n=this.#qs||new Map;this.#qs=new Map;for(let r=0;r<e.length;r+=2){const s=e[r],i=e[r+1];if(this.addAttribute(s,i),t)continue;const a=n.get(s);a&&a.value===i||(t=!0)}return t}insertChild(e,t){if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");const n=Tn.create(this.#Cs,this.ownerDocument,this.#Rs,t);return this.childrenInternal.splice(e?this.childrenInternal.indexOf(e)+1:0,0,n),this.renumber(),n}removeChild(e){const t=e.pseudoType();if(t){const n=this.#Us.get(t)?.filter((t=>t!==e));n&&n.length>0?this.#Us.set(t,n):this.#Us.delete(t)}else{const t=this.shadowRootsInternal.indexOf(e);if(-1!==t)this.shadowRootsInternal.splice(t,1);else{if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(-1===this.childrenInternal.indexOf(e))throw new Error("DOMNode._children is expected to contain the node to be removed.");this.childrenInternal.splice(this.childrenInternal.indexOf(e),1)}}e.parentNode=null,this.#zs-=e.#zs,e.#zs&&this.#Cs.dispatchEventToListeners(wn.MarkersChanged,this),this.renumber()}setChildrenPayload(e){this.childrenInternal=[];for(let t=0;t<e.length;++t){const n=e[t],r=Tn.create(this.#Cs,this.ownerDocument,this.#Rs,n);this.childrenInternal.push(r)}this.renumber()}setPseudoElements(e){if(e)for(let t=0;t<e.length;++t){const n=Tn.create(this.#Cs,this.ownerDocument,this.#Rs,e[t]);n.parentNode=this;const r=n.pseudoType();if(!r)throw new Error("DOMNode.pseudoType() is expected to be defined.");const s=this.#Us.get(r);s?s.push(n):this.#Us.set(r,[n])}}setDistributedNodePayloads(e){this.#Hs=[];for(const t of e)this.#Hs.push(new xn(this.#Cs.target(),t.backendNodeId,t.nodeType,t.nodeName))}setAssignedSlot(e){this.assignedSlot=new xn(this.#Cs.target(),e.backendNodeId,e.nodeType,e.nodeName)}renumber(){if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(this.childNodeCountInternal=this.childrenInternal.length,0===this.childNodeCountInternal)return this.firstChild=null,void(this.lastChild=null);this.firstChild=this.childrenInternal[0],this.lastChild=this.childrenInternal[this.childNodeCountInternal-1];for(let e=0;e<this.childNodeCountInternal;++e){const t=this.childrenInternal[e];t.index=e,t.nextSibling=e+1<this.childNodeCountInternal?this.childrenInternal[e+1]:null,t.previousSibling=e-1>=0?this.childrenInternal[e-1]:null,t.parentNode=this}}addAttribute(e,t){const n={name:e,value:t,_node:this};this.#qs.set(e,n)}setAttributeInternal(e,t){const n=this.#qs.get(e);n?n.value=t:this.addAttribute(e,t)}removeAttributeInternal(e){this.#qs.delete(e)}copyTo(e,t,n){this.#Ts.invoke_copyTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Cs.markUndoableState(),n&&n(e.getError()||null,this.#Cs.nodeForId(e.nodeId))}))}moveTo(e,t,n){this.#Ts.invoke_moveTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Cs.markUndoableState(),n&&n(e.getError()||null,this.#Cs.nodeForId(e.nodeId))}))}isXMLNode(){return Boolean(this.#Fs)}setMarker(e,t){if(null!==t){if(this.parentNode&&!this.#_s.has(e))for(let e=this;e;e=e.parentNode)++e.#zs;this.#_s.set(e,t);for(let e=this;e;e=e.parentNode)this.#Cs.dispatchEventToListeners(wn.MarkersChanged,e)}else{if(!this.#_s.has(e))return;this.#_s.delete(e);for(let e=this;e;e=e.parentNode)--e.#zs;for(let e=this;e;e=e.parentNode)this.#Cs.dispatchEventToListeners(wn.MarkersChanged,e)}}marker(e){return this.#_s.get(e)||null}getMarkerKeysForTest(){return[...this.#_s.keys()]}traverseMarkers(e){!function t(n){if(n.#zs){for(const t of n.#_s.keys())e(n,t);if(n.childrenInternal)for(const e of n.childrenInternal)t(e)}}(this)}resolveURL(t){if(!t)return t;for(let n=this;n;n=n.parentNode)if(n instanceof Mn&&n.baseURL)return e.ParsedURL.ParsedURL.completeURL(n.baseURL,t);return null}highlight(e){this.#Cs.overlayModel().highlightInOverlay({node:this,selectorList:void 0},e)}highlightForTwoSeconds(){this.#Cs.overlayModel().highlightInOverlayForTwoSeconds({node:this,selectorList:void 0})}async resolveToObject(e){const{object:t}=await this.#Ts.invoke_resolveNode({nodeId:this.id,backendNodeId:void 0,objectGroup:e});return t&&this.#Cs.runtimeModelInternal.createRemoteObject(t)||null}async boxModel(){const{model:e}=await this.#Ts.invoke_getBoxModel({nodeId:this.id});return e}async setAsInspectedNode(){let e=this;for(e&&e.pseudoType()&&(e=e.parentNode);e;){let t=e.ancestorUserAgentShadowRoot();if(!t)break;if(t=e.ancestorShadowHost(),!t)break;e=t}if(!e)throw new Error("In DOMNode.setAsInspectedNode: node is expected to not be null.");await this.#Ts.invoke_setInspectedNode({nodeId:e.id})}enclosingElementOrSelf(){let e=this;return e&&e.nodeType()===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e&&e.nodeType()!==Node.ELEMENT_NODE&&(e=null),e}async scrollIntoView(){const e=this.enclosingElementOrSelf();if(!e)return;const t=await e.resolveToObject();t&&(t.callFunction((function(){this.scrollIntoViewIfNeeded(!0)})),t.release(),e.highlightForTwoSeconds())}async focus(){const e=this.enclosingElementOrSelf();if(!e)throw new Error("DOMNode.focus expects node to not be null.");const t=await e.resolveToObject();t&&(await t.callFunction((function(){this.focus()})),t.release(),e.highlightForTwoSeconds(),await this.#Cs.target().pageAgent().invoke_bringToFront())}simpleSelector(){const e=this.localName()||this.nodeName().toLowerCase();if(this.nodeType()!==Node.ELEMENT_NODE)return e;const t=this.getAttribute("type"),n=this.getAttribute("id"),r=this.getAttribute("class");if("input"===e&&t&&!n&&!r)return e+'[type="'+CSS.escape(t)+'"]';if(n)return e+"#"+CSS.escape(n);if(r){return("div"===e?"":e)+"."+r.trim().split(/\s+/g).map((e=>CSS.escape(e))).join(".")}return e}}!function(e){let t;!function(e){e.UserAgent="user-agent",e.Open="open",e.Closed="closed"}(t=e.ShadowRootTypes||(e.ShadowRootTypes={}))}(Tn||(Tn={}));class Rn{#Cs;#xs;constructor(e,t){this.#Cs=e.model(Pn),this.#xs=t}resolve(e){this.resolvePromise().then(e)}async resolvePromise(){const e=await this.#Cs.pushNodesByBackendIdsToFrontend(new Set([this.#xs]));return e&&e.get(this.#xs)||null}backendNodeId(){return this.#xs}domModel(){return this.#Cs}highlight(){this.#Cs.overlayModel().highlightInOverlay({deferredNode:this,selectorList:void 0})}}class xn{nodeType;nodeName;deferredNode;constructor(e,t,n,r){this.nodeType=n,this.nodeName=r,this.deferredNode=new Rn(e,t)}}class Mn extends Tn{body;documentElement;documentURL;baseURL;constructor(e,t){super(e),this.body=null,this.documentElement=null,this.init(this,!1,t),this.documentURL=t.documentURL||"",this.baseURL=t.baseURL||""}}class Pn extends c{agent;idToDOMNode=new Map;#Ws;#Vs;runtimeModelInternal;#Gs;#Ks;#$s;#Qs;#Xs;constructor(e){super(e),this.agent=e.domAgent(),this.#Ws=null,this.#Vs=new Set,e.registerDOMDispatcher(new Ln(this)),this.runtimeModelInternal=e.model(Cr),this.#Ks=null,e.suspended()||this.agent.invoke_enable({}),o.Runtime.experiments.isEnabled("captureNodeCreationStacks")&&this.agent.invoke_setNodeStackTracesEnabled({enable:!0})}runtimeModel(){return this.runtimeModelInternal}cssModel(){return this.target().model(en)}overlayModel(){return this.target().model(vn)}static cancelSearch(){for(const e of K.instance().models(Pn))e.cancelSearch()}scheduleMutationEvent(e){this.hasEventListeners(wn.DOMMutated)&&(this.#Gs=(this.#Gs||0)+1,Promise.resolve().then(function(e,t){if(!this.hasEventListeners(wn.DOMMutated)||this.#Gs!==t)return;this.dispatchEventToListeners(wn.DOMMutated,e)}.bind(this,e,this.#Gs)))}requestDocument(){return this.#Ws?Promise.resolve(this.#Ws):(this.#Ks||(this.#Ks=this.requestDocumentInternal()),this.#Ks)}async getOwnerNodeForFrame(e){const t=await this.agent.invoke_getFrameOwner({frameId:e});return t.getError()?null:new Rn(this.target(),t.backendNodeId)}async requestDocumentInternal(){const e=await this.agent.invoke_getDocument({});if(e.getError())return null;const{root:t}=e;if(this.#Ks=null,t&&this.setDocument(t),!this.#Ws)return console.error("No document"),null;const n=this.parentModel();if(n&&!this.#$s){await n.requestDocument();const e=this.target().model(jn)?.mainFrame;if(e){const t=await n.agent.invoke_getFrameOwner({frameId:e.id});!t.getError()&&t.nodeId&&(this.#$s=n.nodeForId(t.nodeId))}}if(this.#$s){const e=this.#$s.contentDocument();this.#$s.setContentDocument(this.#Ws),this.#$s.setChildren([]),this.#Ws?(this.#Ws.parentNode=this.#$s,this.dispatchEventToListeners(wn.NodeInserted,this.#Ws)):e&&this.dispatchEventToListeners(wn.NodeRemoved,{node:e,parent:this.#$s})}return this.#Ws}existingDocument(){return this.#Ws}async pushNodeToFrontend(e){await this.requestDocument();const{nodeId:t}=await this.agent.invoke_requestNode({objectId:e});return t?this.nodeForId(t):null}pushNodeByPathToFrontend(e){return this.requestDocument().then((()=>this.agent.invoke_pushNodeByPathToFrontend({path:e}))).then((({nodeId:e})=>e))}async pushNodesByBackendIdsToFrontend(e){await this.requestDocument();const t=[...e],{nodeIds:n}=await this.agent.invoke_pushNodesByBackendIdsToFrontend({backendNodeIds:t});if(!n)return null;const r=new Map;for(let e=0;e<n.length;++e)n[e]&&r.set(t[e],this.nodeForId(n[e]));return r}attributeModified(e,t,n){const r=this.idToDOMNode.get(e);r&&(r.setAttributeInternal(t,n),this.dispatchEventToListeners(wn.AttrModified,{node:r,name:t}),this.scheduleMutationEvent(r))}attributeRemoved(e,t){const n=this.idToDOMNode.get(e);n&&(n.removeAttributeInternal(t),this.dispatchEventToListeners(wn.AttrRemoved,{node:n,name:t}),this.scheduleMutationEvent(n))}inlineStyleInvalidated(e){t.SetUtilities.addAll(this.#Vs,e),this.#Qs||(this.#Qs=window.setTimeout(this.loadNodeAttributes.bind(this),20))}loadNodeAttributes(){this.#Qs=void 0;for(const e of this.#Vs)this.agent.invoke_getAttributes({nodeId:e}).then((({attributes:t})=>{if(!t)return;const n=this.idToDOMNode.get(e);n&&n.setAttributesPayload(t)&&(this.dispatchEventToListeners(wn.AttrModified,{node:n,name:"style"}),this.scheduleMutationEvent(n))}));this.#Vs.clear()}characterDataModified(e,t){const n=this.idToDOMNode.get(e);n?(n.setNodeValueInternal(t),this.dispatchEventToListeners(wn.CharacterDataModified,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}nodeForId(e){return e&&this.idToDOMNode.get(e)||null}documentUpdated(){const e=this.#Ks;this.setDocument(null),this.parentModel()&&!e&&this.requestDocument()}setDocument(e){this.idToDOMNode=new Map,this.#Ws=e&&"nodeId"in e?new Mn(this,e):null,An.instance().dispose(this),this.parentModel()||this.dispatchEventToListeners(wn.DocumentUpdated,this)}setDetachedRoot(e){"#document"===e.nodeName?new Mn(this,e):Tn.create(this,null,!1,e)}setChildNodes(e,t){if(!e&&t.length)return void this.setDetachedRoot(t[0]);this.idToDOMNode.get(e)?.setChildrenPayload(t)}childNodeCountUpdated(e,t){const n=this.idToDOMNode.get(e);n?(n.setChildNodeCount(t),this.dispatchEventToListeners(wn.ChildNodeCountUpdated,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}childNodeInserted(e,t,n){const r=this.idToDOMNode.get(e),s=this.idToDOMNode.get(t);if(!r)return void console.error("parentId could not be resolved to a node");const i=r.insertChild(s,n);this.idToDOMNode.set(i.id,i),this.dispatchEventToListeners(wn.NodeInserted,i),this.scheduleMutationEvent(i)}childNodeRemoved(e,t){const n=this.idToDOMNode.get(e),r=this.idToDOMNode.get(t);n&&r?(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(wn.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r)):console.error("parentId or nodeId could not be resolved to a node")}shadowRootPushed(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=Tn.create(this,n.ownerDocument,!0,t);r.parentNode=n,this.idToDOMNode.set(r.id,r),n.shadowRootsInternal.unshift(r),this.dispatchEventToListeners(wn.NodeInserted,r),this.scheduleMutationEvent(r)}shadowRootPopped(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(wn.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}pseudoElementAdded(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=Tn.create(this,n.ownerDocument,!1,t);r.parentNode=n,this.idToDOMNode.set(r.id,r);const s=r.pseudoType();if(!s)throw new Error("DOMModel._pseudoElementAdded expects pseudoType to be defined.");const i=n.pseudoElements().get(s);i?i.push(r):n.pseudoElements().set(s,[r]),this.dispatchEventToListeners(wn.NodeInserted,r),this.scheduleMutationEvent(r)}topLayerElementsUpdated(){this.dispatchEventToListeners(wn.TopLayerElementsChanged)}pseudoElementRemoved(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(wn.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}distributedNodesUpdated(e,t){const n=this.idToDOMNode.get(e);n&&(n.setDistributedNodePayloads(t),this.dispatchEventToListeners(wn.DistributedNodesChanged,n),this.scheduleMutationEvent(n))}unbind(e){this.idToDOMNode.delete(e.id);const t=e.children();for(let e=0;t&&e<t.length;++e)this.unbind(t[e]);for(let t=0;t<e.shadowRootsInternal.length;++t)this.unbind(e.shadowRootsInternal[t]);const n=e.pseudoElements();for(const e of n.values())for(const t of e)this.unbind(t);const r=e.templateContent();r&&this.unbind(r)}async getNodesByStyle(e,t=!1){if(await this.requestDocument(),!this.#Ws)throw new Error("DOMModel.getNodesByStyle expects to have a document.");const n=await this.agent.invoke_getNodesForSubtreeByStyle({nodeId:this.#Ws.id,computedStyles:e,pierce:t});if(n.getError())throw n.getError();return n.nodeIds}async performSearch(e,t){const n=await this.agent.invoke_performSearch({query:e,includeUserAgentShadowDOM:t});return n.getError()||(this.#Xs=n.searchId),n.getError()?0:n.resultCount}async searchResult(e){if(!this.#Xs)return null;const{nodeIds:t}=await this.agent.invoke_getSearchResults({searchId:this.#Xs,fromIndex:e,toIndex:e+1});return t&&1===t.length?this.nodeForId(t[0]):null}cancelSearch(){this.#Xs&&(this.agent.invoke_discardSearchResults({searchId:this.#Xs}),this.#Xs=void 0)}classNamesPromise(e){return this.agent.invoke_collectClassNamesFromSubtree({nodeId:e}).then((({classNames:e})=>e||[]))}querySelector(e,t){return this.agent.invoke_querySelector({nodeId:e,selector:t}).then((({nodeId:e})=>e))}querySelectorAll(e,t){return this.agent.invoke_querySelectorAll({nodeId:e,selector:t}).then((({nodeIds:e})=>e))}getTopLayerElements(){return this.agent.invoke_getTopLayerElements().then((({nodeIds:e})=>e))}markUndoableState(e){An.instance().markUndoableState(this,e||!1)}async nodeForLocation(e,t,n){const r=await this.agent.invoke_getNodeForLocation({x:e,y:t,includeUserAgentShadowDOM:n});return r.getError()||!r.nodeId?null:this.nodeForId(r.nodeId)}async getContainerForNode(e,t,n,r){const{nodeId:s}=await this.agent.invoke_getContainerForNode({nodeId:e,containerName:t,physicalAxes:n,logicalAxes:r});return s?this.nodeForId(s):null}pushObjectAsNodeToFrontend(e){return e.isNode()&&e.objectId?this.pushNodeToFrontend(e.objectId):Promise.resolve(null)}suspendModel(){return this.agent.invoke_disable().then((()=>this.setDocument(null)))}async resumeModel(){await this.agent.invoke_enable({})}dispose(){An.instance().dispose(this)}parentModel(){const e=this.target().parentTarget();return e?e.model(Pn):null}getAgent(){return this.agent}registerNode(e){this.idToDOMNode.set(e.id,e)}}!function(e){e.AttrModified="AttrModified",e.AttrRemoved="AttrRemoved",e.CharacterDataModified="CharacterDataModified",e.DOMMutated="DOMMutated",e.NodeInserted="NodeInserted",e.NodeRemoved="NodeRemoved",e.DocumentUpdated="DocumentUpdated",e.ChildNodeCountUpdated="ChildNodeCountUpdated",e.DistributedNodesChanged="DistributedNodesChanged",e.MarkersChanged="MarkersChanged",e.TopLayerElementsChanged="TopLayerElementsChanged"}(wn||(wn={}));class Ln{#Mr;constructor(e){this.#Mr=e}documentUpdated(){this.#Mr.documentUpdated()}attributeModified({nodeId:e,name:t,value:n}){this.#Mr.attributeModified(e,t,n)}attributeRemoved({nodeId:e,name:t}){this.#Mr.attributeRemoved(e,t)}inlineStyleInvalidated({nodeIds:e}){this.#Mr.inlineStyleInvalidated(e)}characterDataModified({nodeId:e,characterData:t}){this.#Mr.characterDataModified(e,t)}setChildNodes({parentId:e,nodes:t}){this.#Mr.setChildNodes(e,t)}childNodeCountUpdated({nodeId:e,childNodeCount:t}){this.#Mr.childNodeCountUpdated(e,t)}childNodeInserted({parentNodeId:e,previousNodeId:t,node:n}){this.#Mr.childNodeInserted(e,t,n)}childNodeRemoved({parentNodeId:e,nodeId:t}){this.#Mr.childNodeRemoved(e,t)}shadowRootPushed({hostId:e,root:t}){this.#Mr.shadowRootPushed(e,t)}shadowRootPopped({hostId:e,rootId:t}){this.#Mr.shadowRootPopped(e,t)}pseudoElementAdded({parentId:e,pseudoElement:t}){this.#Mr.pseudoElementAdded(e,t)}pseudoElementRemoved({parentId:e,pseudoElementId:t}){this.#Mr.pseudoElementRemoved(e,t)}distributedNodesUpdated({insertionPointId:e,distributedNodes:t}){this.#Mr.distributedNodesUpdated(e,t)}topLayerElementsUpdated(){this.#Mr.topLayerElementsUpdated()}}let En;class An{#Js;#Kr;#Ys;constructor(){this.#Js=[],this.#Kr=0,this.#Ys=null}static instance(e={forceNew:null}){const{forceNew:t}=e;return En&&!t||(En=new An),En}async markUndoableState(e,t){this.#Ys&&e!==this.#Ys&&(this.#Ys.markUndoableState(),this.#Ys=null),t&&this.#Ys===e||(this.#Js=this.#Js.slice(0,this.#Kr),this.#Js.push(e),this.#Kr=this.#Js.length,t?this.#Ys=e:(await e.getAgent().invoke_markUndoableState(),this.#Ys=null))}async undo(){if(0===this.#Kr)return Promise.resolve();--this.#Kr,this.#Ys=null,await this.#Js[this.#Kr].getAgent().invoke_undo()}async redo(){if(this.#Kr>=this.#Js.length)return Promise.resolve();++this.#Kr,this.#Ys=null,await this.#Js[this.#Kr-1].getAgent().invoke_redo()}dispose(e){let n=0;for(let t=0;t<this.#Kr;++t)this.#Js[t]===e&&++n;t.ArrayUtilities.removeElement(this.#Js,e),this.#Kr-=n,this.#Ys===e&&(this.#Ys=null)}}c.register(Pn,{capabilities:z.DOM,autostart:!0});var On=Object.freeze({__proto__:null,get DOMNode(){return Tn},DeferredDOMNode:Rn,DOMNodeShortcut:xn,DOMDocument:Mn,DOMModel:Pn,get Events(){return wn},DOMModelUndoStack:An});class Nn{#Er;#Zs;#mt;#we;#Ce;#Te;#ei;#kt;#ti;#ni;#ri;#si;#ii;#ai;#St;#oi;constructor(n,r,s,i,a,o,l,d,c,h){this.#Er=n,this.#Zs=r,this.url=s,this.#we=i,this.#Ce=a,this.#Te=o,this.#ei=l||e.ResourceType.resourceTypes.Other,this.#kt=d,this.#ti=!1,this.#ni=c&&t.DateUtilities.isValid(c)?c:null,this.#ri=h,this.#ai=[],this.#Zs&&!this.#Zs.finished&&this.#Zs.addEventListener(Te.FinishedLoading,this.requestFinished,this)}lastModified(){if(this.#ni||!this.#Zs)return this.#ni;const e=this.#Zs.responseLastModified(),n=e?new Date(e):null;return this.#ni=n&&t.DateUtilities.isValid(n)?n:null,this.#ni}contentSize(){return"number"!=typeof this.#ri&&this.#Zs?this.#Zs.resourceSize:this.#ri}get request(){return this.#Zs}get url(){return this.#mt}set url(t){this.#mt=t,this.#St=new e.ParsedURL.ParsedURL(t)}get parsedURL(){return this.#St}get documentURL(){return this.#we}get frameId(){return this.#Ce}get loaderId(){return this.#Te}get displayName(){return this.#St?this.#St.displayName:""}resourceType(){return this.#Zs?this.#Zs.resourceType():this.#ei}get mimeType(){return this.#Zs?this.#Zs.mimeType:this.#kt}get content(){return this.#si}get isGenerated(){return this.#ti}set isGenerated(e){this.#ti=e}contentURL(){return this.#mt}contentType(){return this.resourceType()===e.ResourceType.resourceTypes.Document&&-1!==this.mimeType.indexOf("javascript")?e.ResourceType.resourceTypes.Script:this.resourceType()}async requestContent(){return void 0!==this.#si?{content:this.#si,isEncoded:this.#ii}:new Promise((e=>{this.#ai.push(e),this.#Zs&&!this.#Zs.finished||this.innerRequestContent()}))}canonicalMimeType(){return this.contentType().canonicalMimeType()||this.mimeType}async searchInContent(e,t,n){if(!this.frameId)return[];if(this.request)return this.request.searchInContent(e,t,n);return(await this.#Er.target().pageAgent().invoke_searchInResource({frameId:this.frameId,url:this.url,query:e,caseSensitive:t,isRegex:n})).result||[]}async populateImageSource(e){const{content:t}=await this.requestContent(),n=this.#ii;e.src=r.ContentProvider.contentAsDataURL(t,this.#kt,n)||this.#mt}requestFinished(){this.#Zs&&this.#Zs.removeEventListener(Te.FinishedLoading,this.requestFinished,this),this.#ai.length&&this.innerRequestContent()}async innerRequestContent(){if(this.#oi)return;this.#oi=!0;let e=null;if(this.request){const t=await this.request.contentData();t.error||(this.#si=t.content,this.#ii=t.encoded,e={content:t.content,isEncoded:t.encoded})}if(!e){const t=await this.#Er.target().pageAgent().invoke_getResourceContent({frameId:this.frameId,url:this.url}),n=t.getError();n?(this.#si=null,e={content:null,error:n,isEncoded:!1}):(this.#si=t.content,e={content:t.content,isEncoded:t.base64Encoded}),this.#ii=t.base64Encoded}null===this.#si&&(this.#ii=!1);for(const t of this.#ai.splice(0))t(e);this.#oi=void 0}hasTextContent(){return!!this.#ei.isTextType()||this.#ei===e.ResourceType.resourceTypes.Other&&(Boolean(this.#si)&&!this.#ii)}frame(){return this.#Ce?this.#Er.frameForId(this.#Ce):null}statusCode(){return this.#Zs?this.#Zs.statusCode:0}}var Fn,Bn=Object.freeze({__proto__:null,Resource:Nn});class Dn extends c{#li;#di;#ci;constructor(e){super(e),this.#li="",this.#di="",this.#ci=new Set}updateSecurityOrigins(e){const t=this.#ci;this.#ci=e;for(const e of t)this.#ci.has(e)||this.dispatchEventToListeners(Fn.SecurityOriginRemoved,e);for(const e of this.#ci)t.has(e)||this.dispatchEventToListeners(Fn.SecurityOriginAdded,e)}securityOrigins(){return[...this.#ci]}mainSecurityOrigin(){return this.#li}unreachableMainSecurityOrigin(){return this.#di}setMainSecurityOrigin(e,t){this.#li=e,this.#di=t||null,this.dispatchEventToListeners(Fn.MainSecurityOriginChanged,{mainSecurityOrigin:this.#li,unreachableMainSecurityOrigin:this.#di})}}!function(e){e.SecurityOriginAdded="SecurityOriginAdded",e.SecurityOriginRemoved="SecurityOriginRemoved",e.MainSecurityOriginChanged="MainSecurityOriginChanged"}(Fn||(Fn={})),c.register(Dn,{capabilities:z.None,autostart:!1});var Un,Hn=Object.freeze({__proto__:null,SecurityOriginManager:Dn,get Events(){return Fn}});class qn extends c{#hi;#ui;constructor(e){super(e),this.#hi="",this.#ui=new Set}updateStorageKeys(e){const t=this.#ui;this.#ui=e;for(const e of t)this.#ui.has(e)||this.dispatchEventToListeners(Un.StorageKeyRemoved,e);for(const e of this.#ui)t.has(e)||this.dispatchEventToListeners(Un.StorageKeyAdded,e)}storageKeys(){return[...this.#ui]}mainStorageKey(){return this.#hi}setMainStorageKey(e){this.#hi=e,this.dispatchEventToListeners(Un.MainStorageKeyChanged,{mainStorageKey:this.#hi})}}!function(e){e.StorageKeyAdded="StorageKeyAdded",e.StorageKeyRemoved="StorageKeyRemoved",e.MainStorageKeyChanged="MainStorageKeyChanged"}(Un||(Un={})),c.register(qn,{capabilities:z.None,autostart:!1});var _n,zn=Object.freeze({__proto__:null,StorageKeyManager:qn,parseStorageKey:function(t){const n=t.split("^"),r={origin:e.ParsedURL.ParsedURL.extractOrigin(n[0]),components:new Map};for(let e=1;e<n.length;++e)r.components.set(n[e].charAt(0),n[e].substring(1));return r},get Events(){return Un}});class jn extends c{agent;storageAgent;#gi;#pi;framesInternal;#mi;#fi;#bi;isInterstitialShowing;mainFrame;#yi;#vi;constructor(e){super(e);const t=e.model(ne);t&&(t.addEventListener(re.RequestFinished,this.onRequestFinished,this),t.addEventListener(re.RequestUpdateDropped,this.onRequestUpdateDropped,this)),this.agent=e.pageAgent(),this.storageAgent=e.storageAgent(),this.agent.invoke_enable(),this.#gi=e.model(Dn),this.#pi=e.model(qn),this.#yi=new Set,this.#vi=new Set,e.registerPageDispatcher(new Vn(this)),e.registerPreloadDispatcher(new Gn(this)),this.framesInternal=new Map,this.#mi=!1,this.#fi=null,this.#bi=0,this.isInterstitialShowing=!1,this.mainFrame=null,this.#Ii()}async#Ii(){return this.agent.invoke_getResourceTree().then((e=>{this.processCachedResources(e.getError()?null:e.frameTree),this.mainFrame&&this.processPendingEvents(this.mainFrame)}))}static frameForRequest(e){const t=ne.forRequest(e),n=t?t.target().model(jn):null;return n&&e.frameId?n.frameForId(e.frameId):null}static frames(){const e=[];for(const t of K.instance().models(jn))e.push(...t.frames());return e}static resourceForURL(e){for(const t of K.instance().models(jn)){const n=t.mainFrame,r=n?n.resourceForURL(e):null;if(r)return r}return null}static reloadAllPages(e,t){for(const n of K.instance().models(jn))n.target().parentTarget()?.type()!==_.Frame&&n.reloadPage(e,t)}async storageKeyForFrame(e){if(!this.framesInternal.has(e))return null;const t=await this.storageAgent.invoke_getStorageKeyForFrame({frameId:e});return"Frame tree node for given frame not found"===t.getError()?null:t.storageKey}domModel(){return this.target().model(Pn)}processCachedResources(e){e&&":"!==e.frame.url&&(this.dispatchEventToListeners(_n.WillLoadCachedResources),this.addFramesRecursively(null,e),this.target().setInspectedURL(e.frame.url)),this.#mi=!0;const t=this.target().model(Cr);t&&(t.setExecutionContextComparator(this.executionContextComparator.bind(this)),t.fireExecutionContextOrderChanged()),this.dispatchEventToListeners(_n.CachedResourcesLoaded,this)}cachedResourcesLoaded(){return this.#mi}addFrame(e,t){this.framesInternal.set(e.id,e),e.isMainFrame()&&(this.mainFrame=e),this.dispatchEventToListeners(_n.FrameAdded,e),this.updateSecurityOrigins(),this.updateStorageKeys()}frameAttached(e,t,n){const r=t&&this.framesInternal.get(t)||null;if(!this.#mi&&r)return null;if(this.framesInternal.has(e))return null;const s=new Wn(this,r,e,null,n||null);return t&&!r&&(s.crossTargetParentFrameId=t),s.isMainFrame()&&this.mainFrame&&this.frameDetached(this.mainFrame.id,!1),this.addFrame(s,!0),s}frameNavigated(e,t){const n=e.parentId&&this.framesInternal.get(e.parentId)||null;if(!this.#mi&&n)return;let r=this.framesInternal.get(e.id)||null;if(!r&&(r=this.frameAttached(e.id,e.parentId||null),console.assert(Boolean(r)),!r))return;this.dispatchEventToListeners(_n.FrameWillNavigate,r),r.navigate(e),t&&(r.backForwardCacheDetails.restoredFromCache="BackForwardCacheRestore"===t),this.dispatchEventToListeners(_n.FrameNavigated,r),r.isPrimaryFrame()&&this.primaryPageChanged(r,"Navigation");const s=r.resources();for(let e=0;e<s.length;++e)this.dispatchEventToListeners(_n.ResourceAdded,s[e]);r.isMainFrame()&&this.target().setInspectedURL(r.url),this.updateSecurityOrigins(),this.updateStorageKeys(),r.backForwardCacheDetails.restoredFromCache&&(Lt.instance().modelRemoved(this),Lt.instance().modelAdded(this),this.#Ii())}primaryPageChanged(e,t){this.processPendingEvents(e),this.dispatchEventToListeners(_n.PrimaryPageChanged,{frame:e,type:t});const n=this.target().model(ne);n&&e.isOutermostFrame()&&n.clearRequests()}documentOpened(t){this.frameNavigated(t,void 0);const n=this.framesInternal.get(t.id);if(n&&!n.getResourcesMap().get(t.url)){const r=this.createResourceFromFramePayload(t,t.url,e.ResourceType.resourceTypes.Document,t.mimeType,null,null);r.isGenerated=!0,n.addResource(r)}}frameDetached(e,t){if(!this.#mi)return;const n=this.framesInternal.get(e);if(!n)return;const r=n.sameTargetParentFrame();r?r.removeChildFrame(n,t):n.remove(t),this.updateSecurityOrigins(),this.updateStorageKeys()}onRequestFinished(t){if(!this.#mi)return;const n=t.data;if(n.failed||n.resourceType()===e.ResourceType.resourceTypes.XHR)return;const r=n.frameId?this.framesInternal.get(n.frameId):null;r&&r.addRequest(n)}onRequestUpdateDropped(t){if(!this.#mi)return;const n=t.data,r=n.frameId;if(!r)return;const s=this.framesInternal.get(r);if(!s)return;const i=n.url;if(s.getResourcesMap().get(i))return;const a=new Nn(this,null,i,s.url,r,n.loaderId,e.ResourceType.resourceTypes[n.resourceType],n.mimeType,n.lastModified,null);s.addResource(a)}frameForId(e){return this.framesInternal.get(e)||null}forAllResources(e){return!!this.mainFrame&&this.mainFrame.callForFrameResources(e)}frames(){return[...this.framesInternal.values()]}resourceForURL(e){return this.mainFrame?this.mainFrame.resourceForURL(e):null}addFramesRecursively(t,n){const r=n.frame;let s=this.framesInternal.get(r.id);s||(s=new Wn(this,t,r.id,r,null)),!t&&r.parentId&&(s.crossTargetParentFrameId=r.parentId),this.addFrame(s);for(const e of n.childFrames||[])this.addFramesRecursively(s,e);for(let t=0;t<n.resources.length;++t){const i=n.resources[t],a=this.createResourceFromFramePayload(r,i.url,e.ResourceType.resourceTypes[i.type],i.mimeType,i.lastModified||null,i.contentSize||null);s.addResource(a)}if(!s.getResourcesMap().get(r.url)){const t=this.createResourceFromFramePayload(r,r.url,e.ResourceType.resourceTypes.Document,r.mimeType,null,null);s.addResource(t)}}createResourceFromFramePayload(e,t,n,r,s,i){const a="number"==typeof s?new Date(1e3*s):null;return new Nn(this,null,t,e.url,e.id,e.loaderId,n,r,a,i)}suspendReload(){this.#bi++}resumeReload(){if(this.#bi--,console.assert(this.#bi>=0,"Unbalanced call to ResourceTreeModel.resumeReload()"),!this.#bi&&this.#fi){const{ignoreCache:e,scriptToEvaluateOnLoad:t}=this.#fi;this.reloadPage(e,t)}}reloadPage(e,t){if(this.#fi||this.dispatchEventToListeners(_n.PageReloadRequested,this),this.#bi)return void(this.#fi={ignoreCache:e,scriptToEvaluateOnLoad:t});this.#fi=null;const n=this.target().model(ne);n&&n.clearRequests(),this.dispatchEventToListeners(_n.WillReloadPage),this.agent.invoke_reload({ignoreCache:e,scriptToEvaluateOnLoad:t})}navigate(e){return this.agent.invoke_navigate({url:e})}async navigationHistory(){const e=await this.agent.invoke_getNavigationHistory();return e.getError()?null:{currentIndex:e.currentIndex,entries:e.entries}}navigateToHistoryEntry(e){this.agent.invoke_navigateToHistoryEntry({entryId:e.id})}setLifecycleEventsEnabled(e){return this.agent.invoke_setLifecycleEventsEnabled({enabled:e})}async fetchAppManifest(){const e=await this.agent.invoke_getAppManifest();return e.getError()?{url:e.url,data:null,errors:[]}:{url:e.url,data:e.data||null,errors:e.errors}}async getInstallabilityErrors(){return(await this.agent.invoke_getInstallabilityErrors()).installabilityErrors||[]}async getAppId(){return this.agent.invoke_getAppId()}executionContextComparator(e,t){function n(e){let t=e;const n=[];for(;t;)n.push(t),t=t.sameTargetParentFrame();return n.reverse()}if(e.target()!==t.target())return Mr.comparator(e,t);const r=e.frameId?n(this.frameForId(e.frameId)):[],s=t.frameId?n(this.frameForId(t.frameId)):[];let i,a;for(let e=0;;e++)if(!r[e]||!s[e]||r[e]!==s[e]){i=r[e],a=s[e];break}return!i&&a?-1:!a&&i?1:i&&a?i.id.localeCompare(a.id):Mr.comparator(e,t)}getSecurityOriginData(){const t=new Set;let n=null,r=null;for(const s of this.framesInternal.values()){const i=s.securityOrigin;if(i&&(t.add(i),s.isMainFrame()&&(n=i,s.unreachableUrl()))){r=new e.ParsedURL.ParsedURL(s.unreachableUrl()).securityOrigin()}}return{securityOrigins:t,mainSecurityOrigin:n,unreachableMainSecurityOrigin:r}}async getStorageKeyData(){const e=new Set;let t=null;for(const{isMainFrame:n,storageKey:r}of await Promise.all([...this.framesInternal.values()].map((e=>e.getStorageKey(!1).then((t=>({isMainFrame:e.isMainFrame(),storageKey:t})))))))n&&(t=r),r&&e.add(r);return{storageKeys:e,mainStorageKey:t}}updateSecurityOrigins(){const e=this.getSecurityOriginData();this.#gi.setMainSecurityOrigin(e.mainSecurityOrigin||"",e.unreachableMainSecurityOrigin||""),this.#gi.updateSecurityOrigins(e.securityOrigins)}async updateStorageKeys(){const e=await this.getStorageKeyData();this.#pi.setMainStorageKey(e.mainStorageKey||""),this.#pi.updateStorageKeys(e.storageKeys)}async getMainStorageKey(){return this.mainFrame?this.mainFrame.getStorageKey(!1):null}getMainSecurityOrigin(){const e=this.getSecurityOriginData();return e.mainSecurityOrigin||e.unreachableMainSecurityOrigin}onBackForwardCacheNotUsed(e){this.mainFrame&&this.mainFrame.id===e.frameId&&this.mainFrame.loaderId===e.loaderId?(this.mainFrame.setBackForwardCacheDetails(e),this.dispatchEventToListeners(_n.BackForwardCacheDetailsUpdated,this.mainFrame)):this.#yi.add(e)}onPrerenderAttemptCompleted(e){this.mainFrame&&this.mainFrame.id===e.initiatingFrameId?(this.mainFrame.setPrerenderFinalStatus(e.finalStatus),this.dispatchEventToListeners(_n.PrerenderingStatusUpdated,this.mainFrame),e.disallowedApiMethod&&this.mainFrame.setPrerenderDisallowedApiMethod(e.disallowedApiMethod)):this.#vi.add(e),this.dispatchEventToListeners(_n.PrerenderAttemptCompleted,e)}processPendingEvents(e){if(e.isMainFrame()){for(const t of this.#yi)if(e.id===t.frameId&&e.loaderId===t.loaderId){e.setBackForwardCacheDetails(t),this.#yi.delete(t);break}for(const t of this.#vi)if(e.id===t.initiatingFrameId){e.setPrerenderFinalStatus(t.finalStatus),t.disallowedApiMethod&&e.setPrerenderDisallowedApiMethod(t.disallowedApiMethod),this.#vi.delete(t);break}}}}!function(e){e.FrameAdded="FrameAdded",e.FrameNavigated="FrameNavigated",e.FrameDetached="FrameDetached",e.FrameResized="FrameResized",e.FrameWillNavigate="FrameWillNavigate",e.PrimaryPageChanged="PrimaryPageChanged",e.ResourceAdded="ResourceAdded",e.WillLoadCachedResources="WillLoadCachedResources",e.CachedResourcesLoaded="CachedResourcesLoaded",e.DOMContentLoaded="DOMContentLoaded",e.LifecycleEvent="LifecycleEvent",e.Load="Load",e.PageReloadRequested="PageReloadRequested",e.WillReloadPage="WillReloadPage",e.InterstitialShown="InterstitialShown",e.InterstitialHidden="InterstitialHidden",e.BackForwardCacheDetailsUpdated="BackForwardCacheDetailsUpdated",e.PrerenderingStatusUpdated="PrerenderingStatusUpdated",e.PrerenderAttemptCompleted="PrerenderAttemptCompleted",e.JavaScriptDialogOpening="JavaScriptDialogOpening"}(_n||(_n={}));class Wn{#$r;#ki;#E;crossTargetParentFrameId;#Te;#u;#mt;#Si;#wi;#Ci;#Ti;#Ri;#xi;#Mi;#Pi;#Li;#Ei;#Ai;resourcesMap;backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};prerenderFinalStatus;prerenderDisallowedApiMethod;constructor(e,n,r,s,i){this.#$r=e,this.#ki=n,this.#E=r,this.crossTargetParentFrameId=null,this.#Te=s&&s.loaderId||"",this.#u=s&&s.name,this.#mt=s&&s.url||t.DevToolsPath.EmptyUrlString,this.#Si=s&&s.domainAndRegistry||"",this.#wi=s&&s.securityOrigin,this.#Ti=s&&s.unreachableUrl||t.DevToolsPath.EmptyUrlString,this.#Ri=s?.adFrameStatus,this.#xi=s&&s.secureContextType,this.#Mi=s&&s.crossOriginIsolatedContextType,this.#Pi=s&&s.gatedAPIFeatures,this.#Li=i,this.#Ei=null,this.#Ai=new Set,this.resourcesMap=new Map,this.prerenderFinalStatus=null,this.prerenderDisallowedApiMethod=null,this.#ki&&this.#ki.#Ai.add(this)}isSecureContext(){return null!==this.#xi&&this.#xi.startsWith("Secure")}getSecureContextType(){return this.#xi}isCrossOriginIsolated(){return null!==this.#Mi&&this.#Mi.startsWith("Isolated")}getCrossOriginIsolatedContextType(){return this.#Mi}getGatedAPIFeatures(){return this.#Pi}getCreationStackTraceData(){return{creationStackTrace:this.#Li,creationStackTraceTarget:this.#Ei||this.resourceTreeModel().target()}}navigate(e){this.#Te=e.loaderId,this.#u=e.name,this.#mt=e.url,this.#Si=e.domainAndRegistry,this.#wi=e.securityOrigin,this.getStorageKey(!0),this.#Ti=e.unreachableUrl||t.DevToolsPath.EmptyUrlString,this.#Ri=e?.adFrameStatus,this.#xi=e.secureContextType,this.#Mi=e.crossOriginIsolatedContextType,this.#Pi=e.gatedAPIFeatures,this.backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};const n=this.resourcesMap.get(this.#mt);this.resourcesMap.clear(),this.removeChildFrames(),n&&n.loaderId===this.#Te&&this.addResource(n)}resourceTreeModel(){return this.#$r}get id(){return this.#E}get name(){return this.#u||""}get url(){return this.#mt}domainAndRegistry(){return this.#Si}async getAdScriptId(e){return(await this.#$r.agent.invoke_getAdScriptId({frameId:e})).adScriptId||null}get securityOrigin(){return this.#wi}getStorageKey(e){return this.#Ci&&!e||(this.#Ci=this.#$r.storageKeyForFrame(this.#E)),this.#Ci}unreachableUrl(){return this.#Ti}get loaderId(){return this.#Te}adFrameType(){return this.#Ri?.adFrameType||"none"}adFrameStatus(){return this.#Ri}get childFrames(){return[...this.#Ai]}sameTargetParentFrame(){return this.#ki}crossTargetParentFrame(){if(!this.crossTargetParentFrameId)return null;const e=this.#$r.target().parentTarget();if(e?.type()!==_.Frame)return null;const t=e.model(jn);return t&&t.framesInternal.get(this.crossTargetParentFrameId)||null}parentFrame(){return this.sameTargetParentFrame()||this.crossTargetParentFrame()}isMainFrame(){return!this.#ki}isOutermostFrame(){return this.#$r.target().parentTarget()?.type()!==_.Frame&&!this.#ki&&!this.crossTargetParentFrameId}isPrimaryFrame(){return!this.#ki&&this.#$r.target()===K.instance().primaryPageTarget()}removeChildFrame(e,t){this.#Ai.delete(e),e.remove(t)}removeChildFrames(){const e=this.#Ai;this.#Ai=new Set;for(const t of e)t.remove(!1)}remove(e){this.removeChildFrames(),this.#$r.framesInternal.delete(this.id),this.#$r.dispatchEventToListeners(_n.FrameDetached,{frame:this,isSwap:e})}addResource(e){this.resourcesMap.get(e.url)!==e&&(this.resourcesMap.set(e.url,e),this.#$r.dispatchEventToListeners(_n.ResourceAdded,e))}addRequest(e){let t=this.resourcesMap.get(e.url());t&&t.request===e||(t=new Nn(this.#$r,e,e.url(),e.documentURL,e.frameId,e.loaderId,e.resourceType(),e.mimeType,null,null),this.resourcesMap.set(t.url,t),this.#$r.dispatchEventToListeners(_n.ResourceAdded,t))}resources(){return Array.from(this.resourcesMap.values())}resourceForURL(e){const t=this.resourcesMap.get(e);if(t)return t;for(const t of this.#Ai){const n=t.resourceForURL(e);if(n)return n}return null}callForFrameResources(e){for(const t of this.resourcesMap.values())if(e(t))return!0;for(const t of this.#Ai)if(t.callForFrameResources(e))return!0;return!1}displayName(){if(this.isOutermostFrame())return s.i18n.lockedString("top");const t=new e.ParsedURL.ParsedURL(this.#mt).displayName;return t?this.#u?this.#u+" ("+t+")":t:s.i18n.lockedString("iframe")}async getOwnerDeferredDOMNode(){const e=this.parentFrame();return e?e.resourceTreeModel().domModel().getOwnerNodeForFrame(this.#E):null}async getOwnerDOMNodeOrDocument(){const e=await this.getOwnerDeferredDOMNode();return e?e.resolvePromise():this.isOutermostFrame()?this.resourceTreeModel().domModel().requestDocument():null}async highlight(){const e=this.parentFrame(),t=this.resourceTreeModel().target().parentTarget(),n=async e=>{const t=await e.getOwnerNodeForFrame(this.#E);t&&e.overlayModel().highlightInOverlay({deferredNode:t,selectorList:""},"all",!0)};if(e)return n(e.resourceTreeModel().domModel());if(t?.type()===_.Frame){const e=t.model(Pn);if(e)return n(e)}const r=await this.resourceTreeModel().domModel().requestDocument();r&&this.resourceTreeModel().domModel().overlayModel().highlightInOverlay({node:r,selectorList:""},"all",!0)}async getPermissionsPolicyState(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getPermissionsPolicyState({frameId:this.#E});return e.getError()?null:e.states}async getOriginTrials(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getOriginTrials({frameId:this.#E});return e.getError()?[]:e.originTrials}setCreationStackTrace(e){this.#Li=e.creationStackTrace,this.#Ei=e.creationStackTraceTarget}setBackForwardCacheDetails(e){this.backForwardCacheDetails.restoredFromCache=!1,this.backForwardCacheDetails.explanations=e.notRestoredExplanations,this.backForwardCacheDetails.explanationsTree=e.notRestoredExplanationsTree}getResourcesMap(){return this.resourcesMap}setPrerenderFinalStatus(e){this.prerenderFinalStatus=e}setPrerenderDisallowedApiMethod(e){this.prerenderDisallowedApiMethod=e}}class Vn{#Er;constructor(e){this.#Er=e}backForwardCacheNotUsed(e){this.#Er.onBackForwardCacheNotUsed(e)}domContentEventFired({timestamp:e}){this.#Er.dispatchEventToListeners(_n.DOMContentLoaded,e)}loadEventFired({timestamp:e}){this.#Er.dispatchEventToListeners(_n.Load,{resourceTreeModel:this.#Er,loadTime:e})}lifecycleEvent({frameId:e,name:t}){this.#Er.dispatchEventToListeners(_n.LifecycleEvent,{frameId:e,name:t})}frameAttached({frameId:e,parentFrameId:t,stack:n}){this.#Er.frameAttached(e,t,n)}frameNavigated({frame:e,type:t}){this.#Er.frameNavigated(e,t)}documentOpened({frame:e}){this.#Er.documentOpened(e)}frameDetached({frameId:e,reason:t}){this.#Er.frameDetached(e,"swap"===t)}frameStartedLoading({}){}frameStoppedLoading({}){}frameRequestedNavigation({}){}frameScheduledNavigation({}){}frameClearedScheduledNavigation({}){}navigatedWithinDocument({}){}frameResized(){this.#Er.dispatchEventToListeners(_n.FrameResized)}javascriptDialogOpening(e){this.#Er.dispatchEventToListeners(_n.JavaScriptDialogOpening,e),e.hasBrowserHandler||this.#Er.agent.invoke_handleJavaScriptDialog({accept:!1})}javascriptDialogClosed({}){}screencastFrame({}){}screencastVisibilityChanged({}){}interstitialShown(){this.#Er.isInterstitialShowing=!0,this.#Er.dispatchEventToListeners(_n.InterstitialShown)}interstitialHidden(){this.#Er.isInterstitialShowing=!1,this.#Er.dispatchEventToListeners(_n.InterstitialHidden)}windowOpen({}){}compilationCacheProduced({}){}fileChooserOpened({}){}downloadWillBegin({}){}downloadProgress(){}}class Gn{#Er;constructor(e){this.#Er=e}ruleSetUpdated(e){}ruleSetRemoved(e){}prerenderAttemptCompleted(e){this.#Er.onPrerenderAttemptCompleted(e)}prefetchStatusUpdated(e){}prerenderStatusUpdated(e){}preloadEnabledStateUpdated(e){}preloadingAttemptSourcesUpdated(){}}c.register(jn,{capabilities:z.DOM,autostart:!0,early:!0});var Kn=Object.freeze({__proto__:null,ResourceTreeModel:jn,get Events(){return _n},ResourceTreeFrame:Wn,PageDispatcher:Vn});const $n={scriptRemovedOrDeleted:"Script removed or deleted.",unableToFetchScriptSource:"Unable to fetch script source."},Qn=s.i18n.registerUIStrings("core/sdk/Script.ts",$n),Xn=s.i18n.getLocalizedString.bind(void 0,Qn);let Jn=null;class Yn{debuggerModel;scriptId;sourceURL;lineOffset;columnOffset;endLine;endColumn;executionContextId;hash;#Oi;#Ni;sourceMapURL;debugSymbols;hasSourceURL;contentLength;originStackTrace;#Fi;#Bi;#Di;#Ui;isModule;constructor(e,t,n,r,s,i,a,o,l,d,c,h,u,g,p,m,f,b,y,v){this.debuggerModel=e,this.scriptId=t,this.sourceURL=n,this.lineOffset=r,this.columnOffset=s,this.endLine=i,this.endColumn=a,this.isModule=p,this.executionContextId=o,this.hash=l,this.#Oi=d,this.#Ni=c,this.sourceMapURL=h,this.debugSymbols=y,this.hasSourceURL=u,this.contentLength=g,this.originStackTrace=m,this.#Fi=f,this.#Bi=b,this.#Di=null,this.#Ui=v}embedderName(){return this.#Ui}target(){return this.debuggerModel.target()}static trimSourceURLComment(e){let t=e.lastIndexOf("//# sourceURL=");if(-1===t&&(t=e.lastIndexOf("//@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;return e.substr(n+1).match(er)?e.substr(0,n):e}isContentScript(){return this.#Oi}codeOffset(){return this.#Fi}isJavaScript(){return"JavaScript"===this.#Bi}isWasm(){return"WebAssembly"===this.#Bi}scriptLanguage(){return this.#Bi}executionContext(){return this.debuggerModel.runtimeModel().executionContext(this.executionContextId)}isLiveEdit(){return this.#Ni}contentURL(){return this.sourceURL}contentType(){return e.ResourceType.resourceTypes.Script}async loadTextContent(){const e=await this.debuggerModel.target().debuggerAgent().invoke_getScriptSource({scriptId:this.scriptId});if(e.getError())throw new Error(e.getError());const{scriptSource:t,bytecode:n}=e;if(n)return{content:n,isEncoded:!0};let r=t||"";return this.hasSourceURL&&this.sourceURL.startsWith("snippet://")&&(r=Yn.trimSourceURLComment(r)),{content:r,isEncoded:!1}}async loadWasmContent(){if(!this.isWasm())throw new Error("Not a wasm script");const t=await this.debuggerModel.target().debuggerAgent().invoke_disassembleWasmModule({scriptId:this.scriptId});if(t.getError())return this.loadTextContent();const{streamId:n,functionBodyOffsets:r,chunk:{lines:s,bytecodeOffsets:i}}=t,a=[],o=[];let l=s.reduce(((e,t)=>e+t.length+1),0);const d="<truncated>",c=1e9-d.length;if(n)for(;;){const e=await this.debuggerModel.target().debuggerAgent().invoke_nextWasmDisassemblyChunk({streamId:n});if(e.getError())throw new Error(e.getError());const{chunk:{lines:t,bytecodeOffsets:r}}=e;if(l+=t.reduce(((e,t)=>e+t.length+1),0),0===t.length)break;if(l>=c){a.push([d]),o.push([0]);break}a.push(t),o.push(r)}const h=[];for(let e=0;e<r.length;e+=2)h.push({start:r[e],end:r[e+1]});return{content:"",isEncoded:!1,wasmDisassemblyInfo:new e.WasmDisassembly.WasmDisassembly(s.concat(...a),i.concat(...o),h)}}requestContent(){if(!this.#Di){const e=65535;if(this.hash&&!this.#Ni&&this.contentLength>e){Jn||(Jn={cache:new Map,registry:new FinalizationRegistry((e=>Jn?.cache.delete(e)))});const e=[this.#Bi,this.contentLength,this.lineOffset,this.columnOffset,this.endLine,this.endColumn,this.#Fi,this.hash].join(":"),t=Jn.cache.get(e)?.deref();t?this.#Di=t:(this.#Di=this.requestContentInternal(),Jn.cache.set(e,new WeakRef(this.#Di)),Jn.registry.register(this.#Di,e))}else this.#Di=this.requestContentInternal()}return this.#Di}async requestContentInternal(){if(!this.scriptId)return{content:null,error:Xn($n.scriptRemovedOrDeleted),isEncoded:!1};try{return this.isWasm()?await this.loadWasmContent():await this.loadTextContent()}catch(e){return{content:null,error:Xn($n.unableToFetchScriptSource),isEncoded:!1}}}async getWasmBytecode(){const e=await this.debuggerModel.target().debuggerAgent().invoke_getWasmBytecode({scriptId:this.scriptId});return(await fetch(`data:application/wasm;base64,${e.bytecode}`)).arrayBuffer()}originalContentProvider(){return new r.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),(()=>this.requestContent()))}async searchInContent(e,t,n){if(!this.scriptId)return[];return((await this.debuggerModel.target().debuggerAgent().invoke_searchInContent({scriptId:this.scriptId,query:e,caseSensitive:t,isRegex:n})).result||[]).map((e=>new r.ContentProvider.SearchMatch(e.lineNumber,e.lineContent)))}appendSourceURLCommentIfNeeded(e){return this.hasSourceURL?e+"\n //# sourceURL="+this.sourceURL:e}async editSource(e){e=Yn.trimSourceURLComment(e),e=this.appendSourceURLCommentIfNeeded(e);const{content:t}=await this.requestContent();if(t===e)return{changed:!1,status:"Ok"};const n=await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource({scriptId:this.scriptId,scriptSource:e,allowTopFrameEditing:!0});if(n.getError())throw new Error(`Script#editSource failed for script with id ${this.scriptId}: ${n.getError()}`);return n.getError()||"Ok"!==n.status||(this.#Di=Promise.resolve({content:e,isEncoded:!1})),this.debuggerModel.dispatchEventToListeners(cr.ScriptSourceWasEdited,{script:this,status:n.status}),{changed:!0,status:n.status,exceptionDetails:n.exceptionDetails}}rawLocation(e,t){return this.containsLocation(e,t)?new ur(this.debuggerModel,this.scriptId,e,t):null}isInlineScript(){const e=!this.lineOffset&&!this.columnOffset;return!this.isWasm()&&Boolean(this.sourceURL)&&!e}isAnonymousScript(){return!this.sourceURL}async setBlackboxedRanges(e){return!(await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges({scriptId:this.scriptId,positions:e})).getError()}containsLocation(e,t){const n=e===this.lineOffset&&t>=this.columnOffset||e>this.lineOffset,r=e<this.endLine||e===this.endLine&&t<=this.endColumn;return n&&r}get frameId(){return"string"!=typeof this[Zn]&&(this[Zn]=function(e){const t=e.executionContext();if(t)return t.frameId||null;const n=e.debuggerModel.target().model(jn);if(!n||!n.mainFrame)return null;return n.mainFrame.id}(this)),this[Zn]}get isBreakpointCondition(){return[yr,br].includes(this.sourceURL)}createPageResourceLoadInitiator(){return{target:this.target(),frameId:this.frameId,initiatorUrl:this.embedderName()}}rawLocationToRelativeLocation(e){let{lineNumber:t,columnNumber:n}=e;return!this.hasSourceURL&&this.isInlineScript()&&(t-=this.lineOffset,0===t&&void 0!==n&&(n-=this.columnOffset)),{lineNumber:t,columnNumber:n}}relativeLocationToRawLocation(e){let{lineNumber:t,columnNumber:n}=e;return!this.hasSourceURL&&this.isInlineScript()&&(0===t&&void 0!==n&&(n+=this.columnOffset),t+=this.lineOffset),{lineNumber:t,columnNumber:n}}}const Zn=Symbol("frameid");const er=/^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/;var tr=Object.freeze({__proto__:null,Script:Yn,sourceURLRegex:er});const nr={local:"Local",closure:"Closure",block:"Block",script:"Script",withBlock:"`With` block",catchBlock:"`Catch` block",global:"Global",module:"Module",expression:"Expression"},rr=s.i18n.registerUIStrings("core/sdk/DebuggerModel.ts",nr),sr=s.i18n.getLocalizedString.bind(void 0,rr);function ir(e){function t(e,t){return e.lineNumber-t.lineNumber||e.columnNumber-t.columnNumber}function n(e,n){if(e.scriptId!==n.scriptId)return!1;const r=t(e.start,n.start);return r<0?t(e.end,n.start)>=0:!(r>0)||t(e.start,n.end)<=0}if(0===e.length)return[];e.sort(((e,n)=>e.scriptId<n.scriptId?-1:e.scriptId>n.scriptId?1:t(e.start,n.start)||t(e.end,n.end)));let r=e[0];const s=[];for(let i=1;i<e.length;++i){const a=e[i];n(r,a)?t(r.end,a.end)<=0&&(r={...r,end:a.end}):(s.push(r),r=a)}return s.push(r),s}var ar;!function(e){e.StepInto="StepInto",e.StepOut="StepOut",e.StepOver="StepOver"}(ar||(ar={}));class or extends c{agent;runtimeModelInternal;#Hi;#qi;#_i;#zi;#ji;continueToLocationCallback;#Wi;#Vi;#Gi;#Ki;#$i;#Qi;#Xi;evaluateOnCallFrameCallback;#Ji;#Yi=new e.ObjectWrapper.ObjectWrapper;#Zi;#ea;constructor(t){super(t),t.registerDebuggerDispatcher(new hr(this)),this.agent=t.debuggerAgent(),this.runtimeModelInternal=t.model(Cr),this.#Hi=new Jt(t),this.#qi=null,this.#_i=new Map,this.#zi=new Map,this.#ji=[],this.continueToLocationCallback=null,this.#Wi=null,this.#Vi=!1,this.#Gi=null,this.#Ki=0,this.#$i=null,this.#Qi=null,this.#Xi=null,this.evaluateOnCallFrameCallback=null,this.#Ji=null,this.#Zi=null,this.#ea=!1,e.Settings.Settings.instance().moduleSetting("pauseOnExceptionEnabled").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pauseOnCaughtException").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pauseOnUncaughtException").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("disableAsyncStackTraces").addChangeListener(this.asyncStackTracesStateChanged,this),e.Settings.Settings.instance().moduleSetting("breakpointsActive").addChangeListener(this.breakpointsActiveChanged,this),t.suspended()||this.enableDebugger(),this.#Hi.setEnabled(e.Settings.Settings.instance().moduleSetting("jsSourceMapsEnabled").get()),e.Settings.Settings.instance().moduleSetting("jsSourceMapsEnabled").addChangeListener((e=>this.#Hi.setEnabled(e.data)));const n=t.model(jn);n&&n.addEventListener(_n.FrameNavigated,this.onFrameNavigated,this)}sourceMapManager(){return this.#Hi}runtimeModel(){return this.runtimeModelInternal}debuggerEnabled(){return Boolean(this.#Vi)}debuggerId(){return this.#Gi}async enableDebugger(){if(this.#Vi)return;this.#Vi=!0;const t=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,n=this.agent.invoke_enable({maxScriptsCacheSize:t});let r;o.Runtime.experiments.isEnabled(o.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)&&(r=this.agent.invoke_setInstrumentationBreakpoint({instrumentation:"beforeScriptExecution"})),this.pauseOnExceptionStateChanged(),this.asyncStackTracesStateChanged(),e.Settings.Settings.instance().moduleSetting("breakpointsActive").get()||this.breakpointsActiveChanged(),this.dispatchEventToListeners(cr.DebuggerWasEnabled,this);const[s]=await Promise.all([n,r]);this.registerDebugger(s)}async syncDebuggerId(){const e=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,t=this.agent.invoke_enable({maxScriptsCacheSize:e});return t.then(this.registerDebugger.bind(this)),t}onFrameNavigated(){or.shouldResyncDebuggerId||(or.shouldResyncDebuggerId=!0)}registerDebugger(e){if(e.getError())return;const{debuggerId:t}=e;lr.set(t,this),this.#Gi=t,this.dispatchEventToListeners(cr.DebuggerIsReadyToPause,this)}isReadyToPause(){return Boolean(this.#Gi)}static async modelForDebuggerId(e){return or.shouldResyncDebuggerId&&(await or.resyncDebuggerIdForModels(),or.shouldResyncDebuggerId=!1),lr.get(e)||null}static async resyncDebuggerIdForModels(){const e=lr.values();for(const t of e)t.debuggerEnabled()&&await t.syncDebuggerId()}async disableDebugger(){this.#Vi&&(this.#Vi=!1,await this.asyncStackTracesStateChanged(),await this.agent.invoke_disable(),this.#ea=!1,this.globalObjectCleared(),this.dispatchEventToListeners(cr.DebuggerWasDisabled,this),"string"==typeof this.#Gi&&lr.delete(this.#Gi),this.#Gi=null)}skipAllPauses(e){this.#Ki&&(clearTimeout(this.#Ki),this.#Ki=0),this.agent.invoke_setSkipAllPauses({skip:e})}skipAllPausesUntilReloadOrTimeout(e){this.#Ki&&clearTimeout(this.#Ki),this.agent.invoke_setSkipAllPauses({skip:!0}),this.#Ki=window.setTimeout(this.skipAllPauses.bind(this,!1),e)}pauseOnExceptionStateChanged(){const t=e.Settings.Settings.instance().moduleSetting("pauseOnCaughtException").get();let n;const r=e.Settings.Settings.instance().moduleSetting("pauseOnUncaughtException").get();n=t&&r?"all":t?"caught":r?"uncaught":"none",this.agent.invoke_setPauseOnExceptions({state:n})}asyncStackTracesStateChanged(){const t=!e.Settings.Settings.instance().moduleSetting("disableAsyncStackTraces").get()&&this.#Vi?32:0;return this.agent.invoke_setAsyncCallStackDepth({maxDepth:t})}breakpointsActiveChanged(){this.agent.invoke_setBreakpointsActive({active:e.Settings.Settings.instance().moduleSetting("breakpointsActive").get()})}setComputeAutoStepRangesCallback(e){this.#Qi=e}async computeAutoStepSkipList(e){let t=[];if(this.#Qi&&this.#qi&&this.#qi.callFrames.length>0){const[n]=this.#qi.callFrames;t=await this.#Qi.call(null,e,n)}return ir(t.map((({start:e,end:t})=>({scriptId:e.scriptId,start:{lineNumber:e.lineNumber,columnNumber:e.columnNumber},end:{lineNumber:t.lineNumber,columnNumber:t.columnNumber}}))))}async stepInto(){const e=await this.computeAutoStepSkipList(ar.StepInto);this.agent.invoke_stepInto({breakOnAsyncCall:!1,skipList:e})}async stepOver(){this.#Zi=this.#qi?.callFrames[0]?.functionLocation()??null;const e=await this.computeAutoStepSkipList(ar.StepOver);this.agent.invoke_stepOver({skipList:e})}async stepOut(){const e=await this.computeAutoStepSkipList(ar.StepOut);0!==e.length?this.agent.invoke_stepOver({skipList:e}):this.agent.invoke_stepOut()}scheduleStepIntoAsync(){this.computeAutoStepSkipList(ar.StepInto).then((e=>{this.agent.invoke_stepInto({breakOnAsyncCall:!0,skipList:e})}))}resume(){this.agent.invoke_resume({terminateOnResume:!1}),this.#ea=!1}pause(){this.#ea=!0,this.skipAllPauses(!1),this.agent.invoke_pause()}async setBreakpointByURL(n,r,s,a){let o;if(this.target().type()===_.Node&&n.startsWith("file://")){const r=e.ParsedURL.ParsedURL.urlToRawPathString(n,i.Platform.isWin());o=`${t.StringUtilities.escapeForRegExp(r)}|${t.StringUtilities.escapeForRegExp(n)}`,i.Platform.isWin()&&r.match(/^.:\\/)&&(o=`[${r[0].toUpperCase()}${r[0].toLowerCase()}]`+o.substr(1))}let l=0;const d=this.#zi.get(n)||[];for(let e=0,t=d.length;e<t;++e){const t=d[e];r===t.lineOffset&&(l=l?Math.min(l,t.columnOffset):t.columnOffset)}s=Math.max(s||0,l);const c=await this.agent.invoke_setBreakpointByUrl({lineNumber:r,url:o?void 0:n,urlRegex:o,columnNumber:s,condition:a});if(c.getError())return{locations:[],breakpointId:null};let h=[];return c.locations&&(h=c.locations.map((e=>ur.fromPayload(this,e)))),{locations:h,breakpointId:c.breakpointId}}async setBreakpointInAnonymousScript(e,t,n,r){const s=await this.agent.invoke_setBreakpointByUrl({lineNumber:t,scriptHash:e,columnNumber:n,condition:r});if(s.getError())return{locations:[],breakpointId:null};let i=[];return s.locations&&(i=s.locations.map((e=>ur.fromPayload(this,e)))),{locations:i,breakpointId:s.breakpointId}}async removeBreakpoint(e){await this.agent.invoke_removeBreakpoint({breakpointId:e})}async getPossibleBreakpoints(e,t,n){const r=await this.agent.invoke_getPossibleBreakpoints({start:e.payload(),end:t?t.payload():void 0,restrictToFunction:n});return r.getError()||!r.locations?[]:r.locations.map((e=>gr.fromPayload(this,e)))}async fetchAsyncStackTrace(e){const t=await this.agent.invoke_getStackTrace({stackTraceId:e});return t.getError()?null:t.stackTrace}breakpointResolved(e,t){this.#Yi.dispatchEventToListeners(e,ur.fromPayload(this,t))}globalObjectCleared(){this.resetDebuggerPausedDetails(),this.reset(),this.dispatchEventToListeners(cr.GlobalObjectCleared,this)}reset(){for(const e of this.#_i.values())this.#Hi.detachSourceMap(e);this.#_i.clear(),this.#zi.clear(),this.#ji=[],this.#Zi=null}scripts(){return Array.from(this.#_i.values())}scriptForId(e){return this.#_i.get(e)||null}scriptsForSourceURL(e){return this.#zi.get(e)||[]}scriptsForExecutionContext(e){const t=[];for(const n of this.#_i.values())n.executionContextId===e.id&&t.push(n);return t}get callFrames(){return this.#qi?this.#qi.callFrames:null}debuggerPausedDetails(){return this.#qi}async setDebuggerPausedDetails(e){return this.#ea=!1,this.#qi=e,!(this.#$i&&!await this.#$i.call(null,e,this.#Zi))&&(this.#Zi=null,this.dispatchEventToListeners(cr.DebuggerPaused,this),this.setSelectedCallFrame(e.callFrames[0]),!0)}resetDebuggerPausedDetails(){this.#ea=!1,this.#qi=null,this.setSelectedCallFrame(null)}setBeforePausedCallback(e){this.#$i=e}setExpandCallFramesCallback(e){this.#Xi=e}setEvaluateOnCallFrameCallback(e){this.evaluateOnCallFrameCallback=e}setSynchronizeBreakpointsCallback(e){this.#Ji=e}async pausedScript(t,n,r,s,i,a){if("instrumentation"===n){const e=this.scriptForId(r.scriptId);return this.#Ji&&e&&await this.#Ji(e),void this.resume()}const o=new fr(this,t,n,r,s,i,a);if(this.#Xi&&(o.callFrames=await this.#Xi.call(null,o.callFrames)),this.continueToLocationCallback){const e=this.continueToLocationCallback;if(this.continueToLocationCallback=null,e(o))return}await this.setDebuggerPausedDetails(o)?e.EventTarget.fireEvent("DevTools.DebuggerPaused"):this.#Zi?this.stepOver():this.stepInto()}resumedScript(){this.resetDebuggerPausedDetails(),this.dispatchEventToListeners(cr.DebuggerResumed,this)}parsedScriptSource(e,t,n,r,s,a,o,l,d,c,h,u,g,p,m,f,b,y,v,I){const k=this.#_i.get(e);if(k)return k;let S=!1;d&&"isDefault"in d&&(S=!d.isDefault);const w=new Yn(this,e,t,n,r,s,a,o,l,S,c,h,u,p,m,f,b,y,v,I);this.registerScript(w),this.dispatchEventToListeners(cr.ParsedScriptSource,w),w.isInlineScript()&&!w.hasSourceURL&&(w.isModule?i.userMetrics.inlineScriptParsed(0):i.userMetrics.inlineScriptParsed(1)),w.sourceMapURL&&!g&&this.#Hi.attachSourceMap(w,w.sourceURL,w.sourceMapURL);return g&&w.isAnonymousScript()&&(this.#ji.push(w),this.collectDiscardedScripts()),w}setSourceMapURL(e,t){this.#Hi.detachSourceMap(e),e.sourceMapURL=t,this.#Hi.attachSourceMap(e,e.sourceURL,e.sourceMapURL)}async setDebugInfoURL(e,t){this.#Xi&&this.#qi&&(this.#qi.callFrames=await this.#Xi.call(null,this.#qi.callFrames)),this.dispatchEventToListeners(cr.DebugInfoAttached,e)}executionContextDestroyed(e){for(const t of this.#_i.values())t.executionContextId===e.id&&this.#Hi.detachSourceMap(t)}registerScript(e){if(this.#_i.set(e.scriptId,e),e.isAnonymousScript())return;let t=this.#zi.get(e.sourceURL);t||(t=[],this.#zi.set(e.sourceURL,t)),t.unshift(e)}unregisterScript(e){console.assert(e.isAnonymousScript()),this.#_i.delete(e.scriptId)}collectDiscardedScripts(){if(this.#ji.length<1e3)return;const e=this.#ji.splice(0,100);for(const t of e)this.unregisterScript(t),this.dispatchEventToListeners(cr.DiscardedAnonymousScriptSource,t)}createRawLocation(e,t,n,r){return this.createRawLocationByScriptId(e.scriptId,t,n,r)}createRawLocationByURL(e,t,n,r){for(const s of this.#zi.get(e)||[])if(!(s.lineOffset>t||s.lineOffset===t&&void 0!==n&&s.columnOffset>n||s.endLine<t||s.endLine===t&&void 0!==n&&s.endColumn<=n))return new ur(this,s.scriptId,t,n,r);return null}createRawLocationByScriptId(e,t,n,r){return new ur(this,e,t,n,r)}createRawLocationsByStackTrace(e){const t=[];for(let n=e;n;n=n.parent)for(const{scriptId:e,lineNumber:r,columnNumber:s}of n.callFrames)t.push(this.createRawLocationByScriptId(e,r,s));return t}isPaused(){return Boolean(this.debuggerPausedDetails())}isPausing(){return this.#ea}setSelectedCallFrame(e){this.#Wi!==e&&(this.#Wi=e,this.dispatchEventToListeners(cr.CallFrameSelected,this))}selectedCallFrame(){return this.#Wi}async evaluateOnSelectedCallFrame(e){const t=this.selectedCallFrame();if(!t)throw new Error("No call frame selected");return t.evaluate(e)}functionDetailsPromise(e){return e.getAllProperties(!1,!1).then(function(e){if(!e)return null;let t=null;if(e.internalProperties)for(const n of e.internalProperties)"[[FunctionLocation]]"===n.name&&(t=n.value);let n=null;if(e.properties)for(const t of e.properties)"name"===t.name&&t.value&&"string"===t.value.type&&(n=t.value);let r=null;t&&(r=this.createRawLocationByScriptId(t.value.scriptId,t.value.lineNumber,t.value.columnNumber));return{location:r,functionName:n?n.value:""}}.bind(this))}async setVariableValue(e,t,n,r){return(await this.agent.invoke_setVariableValue({scopeNumber:e,variableName:t,newValue:n,callFrameId:r})).getError()}addBreakpointListener(e,t,n){this.#Yi.addEventListener(e,t,n)}removeBreakpointListener(e,t,n){this.#Yi.removeEventListener(e,t,n)}async setBlackboxPatterns(e){return!(await this.agent.invoke_setBlackboxPatterns({patterns:e})).getError()}dispose(){this.#Hi.dispose(),this.#Gi&&lr.delete(this.#Gi),e.Settings.Settings.instance().moduleSetting("pauseOnExceptionEnabled").removeChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pauseOnCaughtException").removeChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("disableAsyncStackTraces").removeChangeListener(this.asyncStackTracesStateChanged,this)}async suspendModel(){await this.disableDebugger()}async resumeModel(){await this.enableDebugger()}static shouldResyncDebuggerId=!1;getContinueToLocationCallback(){return this.continueToLocationCallback}getEvaluateOnCallFrameCallback(){return this.evaluateOnCallFrameCallback}}const lr=new Map;var dr,cr;!function(e){e.DontPauseOnExceptions="none",e.PauseOnAllExceptions="all",e.PauseOnCaughtExceptions="caught",e.PauseOnUncaughtExceptions="uncaught"}(dr||(dr={})),function(e){e.DebuggerWasEnabled="DebuggerWasEnabled",e.DebuggerWasDisabled="DebuggerWasDisabled",e.DebuggerPaused="DebuggerPaused",e.DebuggerResumed="DebuggerResumed",e.DebugInfoAttached="DebugInfoAttached",e.ParsedScriptSource="ParsedScriptSource",e.DiscardedAnonymousScriptSource="DiscardedAnonymousScriptSource",e.GlobalObjectCleared="GlobalObjectCleared",e.CallFrameSelected="CallFrameSelected",e.DebuggerIsReadyToPause="DebuggerIsReadyToPause",e.ScriptSourceWasEdited="ScriptSourceWasEdited"}(cr||(cr={}));class hr{#os;constructor(e){this.#os=e}paused({callFrames:e,reason:t,data:n,hitBreakpoints:r,asyncStackTrace:s,asyncStackTraceId:i}){this.#os.debuggerEnabled()&&this.#os.pausedScript(e,t,n,r||[],s,i)}resumed(){this.#os.debuggerEnabled()&&this.#os.resumedScript()}scriptParsed({scriptId:e,url:t,startLine:n,startColumn:r,endLine:s,endColumn:i,executionContextId:a,hash:o,executionContextAuxData:l,isLiveEdit:d,sourceMapURL:c,hasSourceURL:h,length:u,isModule:g,stackTrace:p,codeOffset:m,scriptLanguage:f,debugSymbols:b,embedderName:y}){this.#os.debuggerEnabled()&&this.#os.parsedScriptSource(e,t,n,r,s,i,a,o,l,Boolean(d),c,Boolean(h),!1,u||0,g||null,p||null,m||null,f||null,b||null,y||null)}scriptFailedToParse({scriptId:e,url:t,startLine:n,startColumn:r,endLine:s,endColumn:i,executionContextId:a,hash:o,executionContextAuxData:l,sourceMapURL:d,hasSourceURL:c,length:h,isModule:u,stackTrace:g,codeOffset:p,scriptLanguage:m,embedderName:f}){this.#os.debuggerEnabled()&&this.#os.parsedScriptSource(e,t,n,r,s,i,a,o,l,!1,d,Boolean(c),!0,h||0,u||null,g||null,p||null,m||null,null,f||null)}breakpointResolved({breakpointId:e,location:t}){this.#os.debuggerEnabled()&&this.#os.breakpointResolved(e,t)}}class ur{debuggerModel;scriptId;lineNumber;columnNumber;inlineFrameIndex;constructor(e,t,n,r,s){this.debuggerModel=e,this.scriptId=t,this.lineNumber=n,this.columnNumber=r||0,this.inlineFrameIndex=s||0}static fromPayload(e,t,n){return new ur(e,t.scriptId,t.lineNumber,t.columnNumber,n)}payload(){return{scriptId:this.scriptId,lineNumber:this.lineNumber,columnNumber:this.columnNumber}}script(){return this.debuggerModel.scriptForId(this.scriptId)}continueToLocation(e){e&&(this.debuggerModel.continueToLocationCallback=this.paused.bind(this,e)),this.debuggerModel.agent.invoke_continueToLocation({location:this.payload(),targetCallFrames:"current"})}paused(e,t){const n=t.callFrames[0].location();return n.scriptId===this.scriptId&&n.lineNumber===this.lineNumber&&n.columnNumber===this.columnNumber&&(e(),!0)}id(){return this.debuggerModel.target().id()+":"+this.scriptId+":"+this.lineNumber+":"+this.columnNumber}}class gr extends ur{type;constructor(e,t,n,r,s){super(e,t,n,r),s&&(this.type=s)}static fromPayload(e,t){return new gr(e,t.scriptId,t.lineNumber,t.columnNumber,t.type)}}class pr{debuggerModel;#ta;payload;#na;#ra;#sa;#ia;#aa;#oa;#la;#da=null;canBeRestarted;constructor(e,t,n,r,s){this.debuggerModel=e,this.#ta=t,this.payload=n,this.#na=ur.fromPayload(e,n.location,r),this.#ra=[],this.#sa=null,this.#ia=r||0,this.#aa=s||n.functionName,this.canBeRestarted=Boolean(n.canBeRestarted);for(let e=0;e<n.scopeChain.length;++e){const t=new mr(this,e);this.#ra.push(t),"local"===t.type()&&(this.#sa=t)}n.functionLocation&&(this.#oa=ur.fromPayload(e,n.functionLocation)),this.#la=n.returnValue?this.debuggerModel.runtimeModel().createRemoteObject(n.returnValue):null}static fromPayloadArray(e,t){const n=[];for(let r=0;r<t.length;++r){const s=t[r],i=e.scriptForId(s.location.scriptId);i&&n.push(new pr(e,i,s))}return n}createVirtualCallFrame(e,t){return new pr(this.debuggerModel,this.#ta,this.payload,e,t)}setMissingDebugInfoDetails(e){this.#da=e}get missingDebugInfoDetails(){return this.#da}get script(){return this.#ta}get id(){return this.payload.callFrameId}get inlineFrameIndex(){return this.#ia}scopeChain(){return this.#ra}localScope(){return this.#sa}thisObject(){return this.payload.this?this.debuggerModel.runtimeModel().createRemoteObject(this.payload.this):null}returnValue(){return this.#la}async setReturnValue(e){if(!this.#la)return null;const t=await this.debuggerModel.agent.invoke_evaluateOnCallFrame({callFrameId:this.id,expression:e,silent:!0,objectGroup:"backtrace"});if(t.getError()||t.exceptionDetails)return null;return(await this.debuggerModel.agent.invoke_setReturnValue({newValue:t.result})).getError()?null:(this.#la=this.debuggerModel.runtimeModel().createRemoteObject(t.result),this.#la)}get functionName(){return this.#aa}location(){return this.#na}functionLocation(){return this.#oa||null}async evaluate(e){const t=this.debuggerModel,n=t.runtimeModel();if((Boolean(e.throwOnSideEffect)||void 0!==e.timeout)&&(!1===n.hasSideEffectSupport()||null===n.hasSideEffectSupport()&&!await n.checkSideEffectSupport()))return{error:"Side-effect checks not supported by backend."};const r=t.getEvaluateOnCallFrameCallback();if(r){const t=await r(this,e);if(t)return t}const s=await this.debuggerModel.agent.invoke_evaluateOnCallFrame({callFrameId:this.id,expression:e.expression,objectGroup:e.objectGroup,includeCommandLineAPI:e.includeCommandLineAPI,silent:e.silent,returnByValue:e.returnByValue,generatePreview:e.generatePreview,throwOnSideEffect:e.throwOnSideEffect,timeout:e.timeout}),i=s.getError();return i?{error:i}:{object:n.createRemoteObject(s.result),exceptionDetails:s.exceptionDetails}}async restart(){console.assert(this.canBeRestarted,"This frame can not be restarted."),await this.debuggerModel.agent.invoke_restartFrame({callFrameId:this.id,mode:"StepInto"})}getPayload(){return this.payload}}class mr{#ca;#ha;#p;#u;#ua;#ga;#pa;#an;constructor(e,t){this.#ca=e,this.#ha=e.getPayload().scopeChain[t],this.#p=this.#ha.type,this.#u=this.#ha.name,this.#ua=t,this.#ga=this.#ha.startLocation?ur.fromPayload(e.debuggerModel,this.#ha.startLocation):null,this.#pa=this.#ha.endLocation?ur.fromPayload(e.debuggerModel,this.#ha.endLocation):null,this.#an=null}callFrame(){return this.#ca}type(){return this.#p}typeName(){switch(this.#p){case"local":return sr(nr.local);case"closure":return sr(nr.closure);case"catch":return sr(nr.catchBlock);case"eval":return s.i18n.lockedString("Eval");case"block":return sr(nr.block);case"script":return sr(nr.script);case"with":return sr(nr.withBlock);case"global":return sr(nr.global);case"module":return sr(nr.module);case"wasm-expression-stack":return sr(nr.expression)}return""}name(){return this.#u}startLocation(){return this.#ga}endLocation(){return this.#pa}object(){if(this.#an)return this.#an;const e=this.#ca.debuggerModel.runtimeModel(),t="with"!==this.#p&&"global"!==this.#p;return this.#an=t?e.createScopeRemoteObject(this.#ha.object,new Oe(this.#ua,this.#ca.id)):e.createRemoteObject(this.#ha.object),this.#an}description(){return"with"!==this.#p&&"global"!==this.#p?"":this.#ha.object.description||""}icon(){}}class fr{debuggerModel;callFrames;reason;auxData;breakpointIds;asyncStackTrace;asyncStackTraceId;constructor(e,t,n,r,s,i,a){this.debuggerModel=e,this.callFrames=pr.fromPayloadArray(e,t),this.reason=n,this.auxData=r,this.breakpointIds=s,i&&(this.asyncStackTrace=this.cleanRedundantFrames(i)),this.asyncStackTraceId=a}exception(){return"exception"!==this.reason&&"promiseRejection"!==this.reason?null:this.debuggerModel.runtimeModel().createRemoteObject(this.auxData)}cleanRedundantFrames(e){let t=e,n=null;for(;t;)"async function"===t.description&&t.callFrames.length&&t.callFrames.shift(),n&&!t.callFrames.length?n.parent=t.parent:n=t,t=t.parent;return e}}c.register(or,{capabilities:z.JS,autostart:!0});const br="debugger://logpoint",yr="debugger://breakpoint";var vr,Ir=Object.freeze({__proto__:null,sortAndMergeRanges:ir,get StepMode(){return ar},DebuggerModel:or,_debuggerIdToModel:lr,get PauseOnExceptionsState(){return dr},get Events(){return cr},Location:ur,BreakLocation:gr,CallFrame:pr,Scope:mr,DebuggerPausedDetails:fr,LOGPOINT_SOURCE_URL:br,COND_BREAKPOINT_SOURCE_URL:yr});class kr extends c{#ma;#fa;#ba;#ya;constructor(e){super(e),e.registerHeapProfilerDispatcher(new Sr(this)),this.#ma=!1,this.#fa=e.heapProfilerAgent(),this.#ba=e.model(Cr),this.#ya=0}debuggerModel(){return this.#ba.debuggerModel()}runtimeModel(){return this.#ba}async enable(){this.#ma||(this.#ma=!0,await this.#fa.invoke_enable())}async startSampling(e){if(this.#ya++)return!1;const t=await this.#fa.invoke_startSampling({samplingInterval:e||16384});return Boolean(t.getError())}async stopSampling(){if(!this.#ya)throw new Error("Sampling profiler is not running.");if(--this.#ya)return this.getSamplingProfile();const e=await this.#fa.invoke_stopSampling();return e.getError()?null:e.profile}async getSamplingProfile(){const e=await this.#fa.invoke_getSamplingProfile();return e.getError()?null:e.profile}async collectGarbage(){const e=await this.#fa.invoke_collectGarbage();return Boolean(e.getError())}async snapshotObjectIdForObjectId(e){const t=await this.#fa.invoke_getHeapObjectId({objectId:e});return t.getError()?null:t.heapSnapshotObjectId}async objectForSnapshotObjectId(e,t){const n=await this.#fa.invoke_getObjectByHeapObjectId({objectId:e,objectGroup:t});return n.getError()?null:this.#ba.createRemoteObject(n.result)}async addInspectedHeapObject(e){const t=await this.#fa.invoke_addInspectedHeapObject({heapObjectId:e});return Boolean(t.getError())}async takeHeapSnapshot(e){await this.#fa.invoke_takeHeapSnapshot(e)}async startTrackingHeapObjects(e){const t=await this.#fa.invoke_startTrackingHeapObjects({trackAllocations:e});return Boolean(t.getError())}async stopTrackingHeapObjects(e){const t=await this.#fa.invoke_stopTrackingHeapObjects({reportProgress:e});return Boolean(t.getError())}heapStatsUpdate(e){this.dispatchEventToListeners(vr.HeapStatsUpdate,e)}lastSeenObjectId(e,t){this.dispatchEventToListeners(vr.LastSeenObjectId,{lastSeenObjectId:e,timestamp:t})}addHeapSnapshotChunk(e){this.dispatchEventToListeners(vr.AddHeapSnapshotChunk,e)}reportHeapSnapshotProgress(e,t,n){this.dispatchEventToListeners(vr.ReportHeapSnapshotProgress,{done:e,total:t,finished:n})}resetProfiles(){this.dispatchEventToListeners(vr.ResetProfiles,this)}}!function(e){e.HeapStatsUpdate="HeapStatsUpdate",e.LastSeenObjectId="LastSeenObjectId",e.AddHeapSnapshotChunk="AddHeapSnapshotChunk",e.ReportHeapSnapshotProgress="ReportHeapSnapshotProgress",e.ResetProfiles="ResetProfiles"}(vr||(vr={}));class Sr{#va;constructor(e){this.#va=e}heapStatsUpdate({statsUpdate:e}){this.#va.heapStatsUpdate(e)}lastSeenObjectId({lastSeenObjectId:e,timestamp:t}){this.#va.lastSeenObjectId(e,t)}addHeapSnapshotChunk({chunk:e}){this.#va.addHeapSnapshotChunk(e)}reportHeapSnapshotProgress({done:e,total:t,finished:n}){this.#va.reportHeapSnapshotProgress(e,t,n)}resetProfiles(){this.#va.resetProfiles()}}c.register(kr,{capabilities:z.JS,autostart:!1});var wr=Object.freeze({__proto__:null,HeapProfilerModel:kr,get Events(){return vr}});class Cr extends c{agent;#Ia;#ka;#Sa;constructor(t){super(t),this.agent=t.runtimeAgent(),this.target().registerRuntimeDispatcher(new xr(this)),this.agent.invoke_enable(),this.#Ia=new Map,this.#ka=Mr.comparator,this.#Sa=null,e.Settings.Settings.instance().moduleSetting("customFormatters").get()&&this.agent.invoke_setCustomObjectFormatterEnabled({enabled:!0}),e.Settings.Settings.instance().moduleSetting("customFormatters").addChangeListener(this.customFormattersStateChanged.bind(this))}static isSideEffectFailure(e){const t="exceptionDetails"in e&&e.exceptionDetails;return Boolean(t&&t.exception&&t.exception.description&&t.exception.description.startsWith("EvalError: Possible side-effect in debug-evaluate"))}debuggerModel(){return this.target().model(or)}heapProfilerModel(){return this.target().model(kr)}executionContexts(){return[...this.#Ia.values()].sort(this.executionContextComparator())}setExecutionContextComparator(e){this.#ka=e}executionContextComparator(){return this.#ka}defaultExecutionContext(){for(const e of this.executionContexts())if(e.isDefault)return e;return null}executionContext(e){return this.#Ia.get(e)||null}executionContextCreated(e){const t=e.auxData||{isDefault:!0},n=new Mr(this,e.id,e.uniqueId,e.name,e.origin,t.isDefault,t.frameId);this.#Ia.set(n.id,n),this.dispatchEventToListeners(Rr.ExecutionContextCreated,n)}executionContextDestroyed(e){const t=this.#Ia.get(e);t&&(this.debuggerModel().executionContextDestroyed(t),this.#Ia.delete(e),this.dispatchEventToListeners(Rr.ExecutionContextDestroyed,t))}fireExecutionContextOrderChanged(){this.dispatchEventToListeners(Rr.ExecutionContextOrderChanged,this)}executionContextsCleared(){this.debuggerModel().globalObjectCleared();const e=this.executionContexts();this.#Ia.clear();for(let t=0;t<e.length;++t)this.dispatchEventToListeners(Rr.ExecutionContextDestroyed,e[t])}createRemoteObject(e){return console.assert("object"==typeof e,"Remote object payload should only be an object"),new Ee(this,e.objectId,e.type,e.subtype,e.value,e.unserializableValue,e.description,e.preview,e.customPreview,e.className)}createScopeRemoteObject(e,t){return new Ae(this,e.objectId,t,e.type,e.subtype,e.value,e.unserializableValue,e.description,e.preview)}createRemoteObjectFromPrimitiveValue(e){const t=typeof e;let n;const r=Le.unserializableDescription(e);return null!==r&&(n=r),void 0!==n&&(e=void 0),new Ee(this,void 0,t,void 0,e,n)}createRemotePropertyFromPrimitiveValue(e,t){return new Ne(e,this.createRemoteObjectFromPrimitiveValue(t))}discardConsoleEntries(){this.agent.invoke_discardConsoleEntries()}releaseObjectGroup(e){this.agent.invoke_releaseObjectGroup({objectGroup:e})}releaseEvaluationResult(e){if("object"in e&&e.object&&e.object.release(),"exceptionDetails"in e&&e.exceptionDetails&&e.exceptionDetails.exception){const t=e.exceptionDetails.exception;this.createRemoteObject({type:t.type,objectId:t.objectId}).release()}}runIfWaitingForDebugger(){this.agent.invoke_runIfWaitingForDebugger()}customFormattersStateChanged({data:e}){this.agent.invoke_setCustomObjectFormatterEnabled({enabled:e})}async compileScript(e,t,n,r){const s=await this.agent.invoke_compileScript({expression:e,sourceURL:t,persistScript:n,executionContextId:r});return s.getError()?(console.error(s.getError()),null):{scriptId:s.scriptId,exceptionDetails:s.exceptionDetails}}async runScript(e,t,n,r,s,i,a,o){const l=await this.agent.invoke_runScript({scriptId:e,executionContextId:t,objectGroup:n,silent:r,includeCommandLineAPI:s,returnByValue:i,generatePreview:a,awaitPromise:o}),d=l.getError();return d?(console.error(d),{error:d}):{object:this.createRemoteObject(l.result),exceptionDetails:l.exceptionDetails}}async queryObjects(e){if(!e.objectId)return{error:"Prototype should be an Object."};const t=await this.agent.invoke_queryObjects({prototypeObjectId:e.objectId,objectGroup:"console"}),n=t.getError();return n?(console.error(n),{error:n}):{objects:this.createRemoteObject(t.objects)}}async isolateId(){const e=await this.agent.invoke_getIsolateId();return e.getError()||!e.id?this.target().id():e.id}async heapUsage(){const e=await this.agent.invoke_getHeapUsage();return e.getError()?null:e}inspectRequested(t,n,r){const s=this.createRemoteObject(t);n&&"copyToClipboard"in n&&Boolean(n.copyToClipboard)?this.copyRequested(s):n&&"queryObjects"in n&&n.queryObjects?this.queryObjectsRequested(s,r):s.isNode()?e.Revealer.reveal(s).then(s.release.bind(s)):"function"!==s.type?s.release():De.objectAsFunction(s).targetFunctionDetails().then((function(t){if(s.release(),!t||!t.location)return;e.Revealer.reveal(t.location)}))}async addBinding(e){return await this.agent.invoke_addBinding(e)}bindingCalled(e){this.dispatchEventToListeners(Rr.BindingCalled,e)}copyRequested(t){if(!t.objectId)return void i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(t.unserializableValue()||t.value);const n=e.Settings.Settings.instance().moduleSetting("textEditorIndent").get();t.callFunctionJSON((function(e){const t=e.subtype,n=e.indent;if("node"===t)return this instanceof Element?this.outerHTML:void 0;if(t&&void 0===this)return String(t);try{return JSON.stringify(this,null,n)}catch(e){return String(this)}}),[{value:{subtype:t.subtype,indent:n}}]).then(i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(i.InspectorFrontendHost.InspectorFrontendHostInstance))}async queryObjectsRequested(t,n){const r=await this.queryObjects(t);t.release(),"error"in r?e.Console.Console.instance().error(r.error):this.dispatchEventToListeners(Rr.QueryObjectRequested,{objects:r.objects,executionContextId:n})}static simpleTextFromException(e){let t=e.text;if(e.exception&&e.exception.description){let n=e.exception.description;-1!==n.indexOf("\n")&&(n=n.substring(0,n.indexOf("\n"))),t+=" "+n}return t}exceptionThrown(e,t){const n={timestamp:e,details:t};this.dispatchEventToListeners(Rr.ExceptionThrown,n)}exceptionRevoked(e){this.dispatchEventToListeners(Rr.ExceptionRevoked,e)}consoleAPICalled(e,t,n,r,s,i){const a={type:e,args:t,executionContextId:n,timestamp:r,stackTrace:s,context:i};this.dispatchEventToListeners(Rr.ConsoleAPICalled,a)}executionContextIdForScriptId(e){const t=this.debuggerModel().scriptForId(e);return t?t.executionContextId:0}executionContextForStackTrace(e){let t=e;for(;t&&!t.callFrames.length;)t=t.parent||null;return t&&t.callFrames.length?this.executionContextIdForScriptId(t.callFrames[0].scriptId):0}hasSideEffectSupport(){return this.#Sa}async checkSideEffectSupport(){const e=this.executionContexts(),t=e[e.length-1];if(!t)return!1;const n=await this.agent.invoke_evaluate({expression:Tr,contextId:t.id,throwOnSideEffect:!0});return this.#Sa=!n.getError()&&Cr.isSideEffectFailure(n),this.#Sa}terminateExecution(){return this.agent.invoke_terminateExecution()}async getExceptionDetails(e){const t=await this.agent.invoke_getExceptionDetails({errorObjectId:e});if(!t.getError())return t.exceptionDetails}}const Tr="(async function(){ await 1; })()";var Rr;!function(e){e.BindingCalled="BindingCalled",e.ExecutionContextCreated="ExecutionContextCreated",e.ExecutionContextDestroyed="ExecutionContextDestroyed",e.ExecutionContextChanged="ExecutionContextChanged",e.ExecutionContextOrderChanged="ExecutionContextOrderChanged",e.ExceptionThrown="ExceptionThrown",e.ExceptionRevoked="ExceptionRevoked",e.ConsoleAPICalled="ConsoleAPICalled",e.QueryObjectRequested="QueryObjectRequested"}(Rr||(Rr={}));class xr{#wa;constructor(e){this.#wa=e}executionContextCreated({context:e}){this.#wa.executionContextCreated(e)}executionContextDestroyed({executionContextId:e}){this.#wa.executionContextDestroyed(e)}executionContextsCleared(){this.#wa.executionContextsCleared()}exceptionThrown({timestamp:e,exceptionDetails:t}){this.#wa.exceptionThrown(e,t)}exceptionRevoked({exceptionId:e}){this.#wa.exceptionRevoked(e)}consoleAPICalled({type:e,args:t,executionContextId:n,timestamp:r,stackTrace:s,context:i}){this.#wa.consoleAPICalled(e,t,n,r,s,i)}inspectRequested({object:e,hints:t,executionContextId:n}){this.#wa.inspectRequested(e,t,n)}bindingCalled(e){this.#wa.bindingCalled(e)}}class Mr{id;uniqueId;name;#Ca;origin;isDefault;runtimeModel;debuggerModel;frameId;constructor(e,t,n,r,s,i,a){this.id=t,this.uniqueId=n,this.name=r,this.#Ca=null,this.origin=s,this.isDefault=i,this.runtimeModel=e,this.debuggerModel=e.debuggerModel(),this.frameId=a,this.setLabelInternal("")}target(){return this.runtimeModel.target()}static comparator(e,t){function n(e){return e.parentTarget()?.type()!==_.Frame?5:e.type()===_.Frame?4:e.type()===_.ServiceWorker?3:e.type()===_.Worker||e.type()===_.SharedWorker?2:1}function r(e){let t=e;const n=[];for(;t;)n.push(t),t=t.parentTarget();return n.reverse()}const s=r(e.target()),i=r(t.target());let a,o;for(let e=0;;e++)if(!s[e]||!i[e]||s[e]!==i[e]){a=s[e],o=i[e];break}if(!a&&o)return-1;if(!o&&a)return 1;if(a&&o){const e=n(a)-n(o);return e?-e:a.id().localeCompare(o.id())}return e.isDefault?-1:t.isDefault?1:e.name.localeCompare(t.name)}async evaluate(e,t,n){if(this.debuggerModel.selectedCallFrame())return this.debuggerModel.evaluateOnSelectedCallFrame(e);return!(Boolean(e.throwOnSideEffect)||void 0!==e.timeout)||this.runtimeModel.hasSideEffectSupport()||!1!==this.runtimeModel.hasSideEffectSupport()&&(await this.runtimeModel.checkSideEffectSupport(),this.runtimeModel.hasSideEffectSupport())?this.evaluateGlobal(e,t,n):{error:"Side-effect checks not supported by backend."}}globalObject(e,t){const n={expression:"this",objectGroup:e,includeCommandLineAPI:!1,silent:!0,returnByValue:!1,generatePreview:t};return this.evaluateGlobal(n,!1,!1)}async evaluateGlobal(e,t,n){e.expression||(e.expression="this");const r=await this.runtimeModel.agent.invoke_evaluate({expression:e.expression,objectGroup:e.objectGroup,includeCommandLineAPI:e.includeCommandLineAPI,silent:e.silent,returnByValue:e.returnByValue,generatePreview:e.generatePreview,userGesture:t,awaitPromise:n,throwOnSideEffect:e.throwOnSideEffect,timeout:e.timeout,disableBreaks:e.disableBreaks,replMode:e.replMode,allowUnsafeEvalBlockedByCSP:e.allowUnsafeEvalBlockedByCSP,...this.uniqueId?{uniqueContextId:this.uniqueId}:{contextId:this.id}}),s=r.getError();return s?(console.error(s),{error:s}):{object:this.runtimeModel.createRemoteObject(r.result),exceptionDetails:r.exceptionDetails}}async globalLexicalScopeNames(){const e=await this.runtimeModel.agent.invoke_globalLexicalScopeNames({executionContextId:this.id});return e.getError()?[]:e.names}label(){return this.#Ca}setLabel(e){this.setLabelInternal(e),this.runtimeModel.dispatchEventToListeners(Rr.ExecutionContextChanged,this)}setLabelInternal(t){if(t)return void(this.#Ca=t);if(this.name)return void(this.#Ca=this.name);const n=e.ParsedURL.ParsedURL.fromString(this.origin);this.#Ca=n?n.lastPathComponentWithFragment():""}}c.register(Cr,{capabilities:z.JS,autostart:!0});var Pr,Lr,Er=Object.freeze({__proto__:null,RuntimeModel:Cr,get Events(){return Rr},ExecutionContext:Mr});!function(e){e.Name="name",e.Description="description",e.Value="value",e.Role="role"}(Pr||(Pr={}));class Ar{#Ta;#E;#Ra;#xa;#Ma;#Pa;#La;#u;#Jt;#g;#Ea;#Aa;#Oa;#Na;constructor(e,t){this.#Ta=e,this.#E=t.nodeId,e.setAXNodeForAXId(this.#E,this),t.backendDOMNodeId?(e.setAXNodeForBackendDOMNodeId(t.backendDOMNodeId,this),this.#Ra=t.backendDOMNodeId,this.#xa=new Rn(e.target(),t.backendDOMNodeId)):(this.#Ra=null,this.#xa=null),this.#Ma=t.ignored,this.#Ma&&"ignoredReasons"in t&&(this.#Pa=t.ignoredReasons),this.#La=t.role||null,this.#u=t.name||null,this.#Jt=t.description||null,this.#g=t.value||null,this.#Ea=t.properties||null,this.#Na=t.childIds||null,this.#Aa=t.parentId||null,t.frameId&&!t.parentId?(this.#Oa=t.frameId,e.setRootAXNodeForFrameId(t.frameId,this)):this.#Oa=null}id(){return this.#E}accessibilityModel(){return this.#Ta}ignored(){return this.#Ma}ignoredReasons(){return this.#Pa||null}role(){return this.#La||null}coreProperties(){const e=[];return this.#u&&e.push({name:Pr.Name,value:this.#u}),this.#Jt&&e.push({name:Pr.Description,value:this.#Jt}),this.#g&&e.push({name:Pr.Value,value:this.#g}),e}name(){return this.#u||null}description(){return this.#Jt||null}value(){return this.#g||null}properties(){return this.#Ea||null}parentNode(){return this.#Aa?this.#Ta.axNodeForId(this.#Aa):null}isDOMNode(){return Boolean(this.#Ra)}backendDOMNodeId(){return this.#Ra}deferredDOMNode(){return this.#xa}highlightDOMNode(){const e=this.deferredDOMNode();e&&e.highlight()}children(){if(!this.#Na)return[];const e=[];for(const t of this.#Na){const n=this.#Ta.axNodeForId(t);n&&e.push(n)}return e}numChildren(){return this.#Na?this.#Na.length:0}hasOnlyUnloadedChildren(){return!(!this.#Na||!this.#Na.length)&&this.#Na.every((e=>null===this.#Ta.axNodeForId(e)))}hasUnloadedChildren(){return!(!this.#Na||!this.#Na.length)&&this.#Na.some((e=>null===this.#Ta.axNodeForId(e)))}getFrameId(){return this.#Oa||this.parentNode()?.getFrameId()||null}}(Lr||(Lr={})).TreeUpdated="TreeUpdated";class Or extends c{agent;#Fa;#Ba;#Da;#Ua;#Ha;constructor(e){super(e),e.registerAccessibilityDispatcher(this),this.agent=e.accessibilityAgent(),this.resumeModel(),this.#Fa=new Map,this.#Ba=new Map,this.#Da=new Map,this.#Ua=new Map,this.#Ha=null}clear(){this.#Ha=null,this.#Fa.clear(),this.#Ba.clear(),this.#Da.clear()}async resumeModel(){await this.agent.invoke_enable()}async suspendModel(){await this.agent.invoke_disable()}async requestPartialAXTree(e){const{nodes:t}=await this.agent.invoke_getPartialAXTree({nodeId:e.id,fetchRelatives:!0});if(!t)return;const n=[];for(const e of t)n.push(new Ar(this,e))}loadComplete({root:e}){this.clear(),this.#Ha=new Ar(this,e),this.dispatchEventToListeners(Lr.TreeUpdated,{root:this.#Ha})}nodesUpdated({nodes:e}){this.createNodesFromPayload(e),this.dispatchEventToListeners(Lr.TreeUpdated,{})}createNodesFromPayload(e){return e.map((e=>new Ar(this,e)))}async requestRootNode(e){if(e&&this.#Da.has(e))return this.#Da.get(e);if(!e&&this.#Ha)return this.#Ha;const{node:t}=await this.agent.invoke_getRootAXNode({frameId:e});return t?this.createNodesFromPayload([t])[0]:void 0}async requestAXChildren(e,t){const n=this.#Fa.get(e);if(!n)throw Error("Cannot request children before parent");if(!n.hasUnloadedChildren())return n.children();const r=this.#Ua.get(e);if(r)await r;else{const n=this.agent.invoke_getChildAXNodes({id:e,frameId:t});this.#Ua.set(e,n);const r=await n;r.getError()||(this.createNodesFromPayload(r.nodes),this.#Ua.delete(e))}return n.children()}async requestAndLoadSubTreeToNode(e){const t=[];let n=this.axNodeForDOMNode(e);for(;n;){t.push(n);const e=n.parentNode();if(!e)return t;n=e}const{nodes:r}=await this.agent.invoke_getAXNodeAndAncestors({backendNodeId:e.backendNodeId()});if(!r)return null;return this.createNodesFromPayload(r)}axNodeForId(e){return this.#Fa.get(e)||null}setRootAXNodeForFrameId(e,t){this.#Da.set(e,t)}axNodeForFrameId(e){return this.#Da.get(e)??null}setAXNodeForAXId(e,t){this.#Fa.set(e,t)}axNodeForDOMNode(e){return e?this.#Ba.get(e.backendNodeId())??null:null}setAXNodeForBackendDOMNodeId(e,t){this.#Ba.set(e,t)}getAgent(){return this.agent}}c.register(Or,{capabilities:z.DOM,autostart:!1});var Nr=Object.freeze({__proto__:null,get CoreAxPropertyName(){return Pr},AccessibilityNode:Ar,get Events(){return Lr},AccessibilityModel:Or});class Fr{#qa;titleInternal;enabledInternal;constructor(e,t){this.#qa=e,this.titleInternal=t,this.enabledInternal=!1}category(){return this.#qa}enabled(){return this.enabledInternal}setEnabled(e){this.enabledInternal=e}title(){return this.titleInternal}setTitle(e){this.titleInternal=e}}var Br=Object.freeze({__proto__:null,CategorizedBreakpoint:Fr});class Dr{onMessage;#_a;#za;#ja;#ar;constructor(){this.onMessage=null,this.#_a=null,this.#za="",this.#ja=0,this.#ar=[i.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(i.InspectorFrontendHostAPI.Events.DispatchMessage,this.dispatchMessage,this),i.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(i.InspectorFrontendHostAPI.Events.DispatchMessageChunk,this.dispatchMessageChunk,this)]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#_a=e}sendRawMessage(e){this.onMessage&&i.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(e)}dispatchMessage(e){this.onMessage&&this.onMessage.call(null,e.data)}dispatchMessageChunk(e){const{messageChunk:t,messageSize:n}=e.data;n&&(this.#za="",this.#ja=n),this.#za+=t,this.#za.length===this.#ja&&this.onMessage&&(this.onMessage.call(null,this.#za),this.#za="",this.#ja=0)}async disconnect(){const t=this.#_a;e.EventTarget.removeEventListeners(this.#ar),this.#_a=null,this.onMessage=null,t&&t.call(null,"force disconnect")}}class Ur{#Wa;onMessage;#_a;#Va;#Ga;#Ka;constructor(e,t){this.#Wa=new WebSocket(e),this.#Wa.onerror=this.onError.bind(this),this.#Wa.onopen=this.onOpen.bind(this),this.#Wa.onmessage=e=>{this.onMessage&&this.onMessage.call(null,e.data)},this.#Wa.onclose=this.onClose.bind(this),this.onMessage=null,this.#_a=null,this.#Va=t,this.#Ga=!1,this.#Ka=[]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#_a=e}onError(){this.#Va&&this.#Va.call(null),this.#_a&&this.#_a.call(null,"connection failed"),this.close()}onOpen(){if(this.#Ga=!0,this.#Wa){this.#Wa.onerror=console.error;for(const e of this.#Ka)this.#Wa.send(e)}this.#Ka=[]}onClose(){this.#Va&&this.#Va.call(null),this.#_a&&this.#_a.call(null,"websocket closed"),this.close()}close(e){this.#Wa&&(this.#Wa.onerror=null,this.#Wa.onopen=null,this.#Wa.onclose=e||null,this.#Wa.onmessage=null,this.#Wa.close(),this.#Wa=null),this.#Va=null}sendRawMessage(e){this.#Ga&&this.#Wa?this.#Wa.send(e):this.#Ka.push(e)}disconnect(){return new Promise((e=>{this.close((()=>{this.#_a&&this.#_a.call(null,"force disconnect"),e()}))}))}}class Hr{onMessage;#_a;constructor(){this.onMessage=null,this.#_a=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#_a=e}sendRawMessage(e){window.setTimeout(this.respondWithError.bind(this,e),0)}respondWithError(e){const t=JSON.parse(e),n={message:"This is a stub connection, can't dispatch message.",code:a.InspectorBackend.DevToolsStubErrorCode,data:t};this.onMessage&&this.onMessage.call(null,{id:t.id,error:n})}async disconnect(){this.#_a&&this.#_a.call(null,"force disconnect"),this.#_a=null,this.onMessage=null}}class qr{#$a;#Qa;onMessage;#_a;constructor(e,t){this.#$a=e,this.#Qa=t,this.onMessage=null,this.#_a=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#_a=e}getOnDisconnect(){return this.#_a}sendRawMessage(e){const t=JSON.parse(e);t.sessionId||(t.sessionId=this.#Qa),this.#$a.sendRawMessage(JSON.stringify(t))}getSessionId(){return this.#Qa}async disconnect(){this.#_a&&this.#_a.call(null,"force disconnect"),this.#_a=null,this.onMessage=null}}function _r(e){const t=o.Runtime.Runtime.queryParam("ws"),n=o.Runtime.Runtime.queryParam("wss");if(t||n){return new Ur(t?`ws://${t}`:`wss://${n}`,e)}return i.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()?new Hr:new Dr}var zr,jr=Object.freeze({__proto__:null,MainConnection:Dr,WebSocketConnection:Ur,StubConnection:Hr,ParallelConnection:qr,initMainConnection:async function(e,t){a.InspectorBackend.Connection.setFactory(_r.bind(null,t)),await e(),i.InspectorFrontendHost.InspectorFrontendHostInstance.connectionReady(),i.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(i.InspectorFrontendHostAPI.Events.ReattachRootTarget,(()=>{const t=K.instance().rootTarget();if(t){const e=t.router();e&&e.connection().disconnect()}e()}))}});class Wr extends c{#Xa;#Ja;#Ya;#Za=new Map;#eo=new Map;#to=new Map;#no=new Map;#ro=null;constructor(e){super(e),this.#Xa=e.targetManager(),this.#Ja=e,this.#Ya=e.targetAgent(),e.registerTargetDispatcher(this);const t=this.#Xa.browserTarget();t?t!==e&&t.targetAgent().invoke_autoAttachRelated({targetId:e.id(),waitForDebuggerOnStart:!0}):this.#Ya.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),e.parentTarget()?.type()===_.Frame||i.InspectorFrontendHost.isUnderTest()||(this.#Ya.invoke_setDiscoverTargets({discover:!0}),this.#Ya.invoke_setRemoteLocations({locations:[{host:"localhost",port:9229}]}))}static install(e){Wr.attachCallback=e,c.register(Wr,{capabilities:z.Target,autostart:!0})}childTargets(){return Array.from(this.#eo.values())}async suspendModel(){await this.#Ya.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0})}async resumeModel(){await this.#Ya.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0})}dispose(){for(const e of this.#eo.keys())this.detachedFromTarget({sessionId:e,targetId:void 0})}targetCreated({targetInfo:e}){this.#Za.set(e.targetId,e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners(zr.TargetCreated,e)}targetInfoChanged({targetInfo:e}){this.#Za.set(e.targetId,e);const t=this.#to.get(e.targetId);if(t)if("prerender"!==t.targetInfo()?.subtype||e.subtype)t.updateTargetInfo(e);else{const n=t.model(jn);t.updateTargetInfo(e),n&&n.mainFrame&&n.primaryPageChanged(n.mainFrame,"Activation")}this.fireAvailableTargetsChanged(),this.dispatchEventToListeners(zr.TargetInfoChanged,e)}targetDestroyed({targetId:e}){this.#Za.delete(e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners(zr.TargetDestroyed,e)}targetCrashed({targetId:e,status:t,errorCode:n}){}fireAvailableTargetsChanged(){K.instance().dispatchEventToListeners($.AvailableTargetsChanged,[...this.#Za.values()])}async getParentTargetId(){return this.#ro||(this.#ro=(await this.#Ja.targetAgent().invoke_getTargetInfo({})).targetInfo.targetId),this.#ro}async attachedToTarget({sessionId:t,targetInfo:n,waitingForDebugger:r}){if(this.#ro===n.targetId)return;let s=_.Browser,i="";if("worker"===n.type&&n.title&&n.title!==n.url)i=n.title;else if(!["page","iframe","webview"].includes(n.type))if("chrome://print/"===n.url||n.url.startsWith("chrome://")&&n.url.endsWith(".top-chrome/"))s=_.Frame;else{const t=e.ParsedURL.ParsedURL.fromString(n.url);i=t?t.lastPathComponentWithFragment():"#"+ ++Wr.lastAnonymousTargetId,"devtools"===t?.scheme&&"other"===n.type&&(s=_.Frame)}"iframe"===n.type||"webview"===n.type||"background_page"===n.type||"app"===n.type||"popup_page"===n.type||"page"===n.type?s=_.Frame:"worker"===n.type?s=_.Worker:"shared_worker"===n.type?s=_.SharedWorker:"service_worker"===n.type?s=_.ServiceWorker:"auction_worklet"===n.type&&(s=_.AuctionWorklet);const a=this.#Xa.createTarget(n.targetId,i,s,this.#Ja,t,void 0,void 0,n);this.#eo.set(t,a),this.#to.set(a.id(),a),Wr.attachCallback&&await Wr.attachCallback({target:a,waitingForDebugger:r}),r&&a.runtimeAgent().invoke_runIfWaitingForDebugger()}detachedFromTarget({sessionId:e}){if(this.#no.has(e))this.#no.delete(e);else{const t=this.#eo.get(e);t&&(t.dispose("target terminated"),this.#eo.delete(e),this.#to.delete(t.id()))}}receivedMessageFromTarget({}){}async createParallelConnection(e){const t=await this.getParentTargetId(),{connection:n,sessionId:r}=await this.createParallelConnectionAndSessionForTarget(this.#Ja,t);return n.setOnMessage(e),this.#no.set(r,n),{connection:n,sessionId:r}}async createParallelConnectionAndSessionForTarget(e,t){const n=e.targetAgent(),r=e.router(),s=(await n.invoke_attachToTarget({targetId:t,flatten:!0})).sessionId,i=new qr(r.connection(),s);return r.registerSession(e,s,i),i.setOnDisconnect((()=>{r.unregisterSession(s),n.invoke_detachFromTarget({sessionId:s})})),{connection:i,sessionId:s}}targetInfos(){return Array.from(this.#Za.values())}static lastAnonymousTargetId=0;static attachCallback}!function(e){e.TargetCreated="TargetCreated",e.TargetDestroyed="TargetDestroyed",e.TargetInfoChanged="TargetInfoChanged"}(zr||(zr={}));var Vr=Object.freeze({__proto__:null,ChildTargetManager:Wr,get Events(){return zr}});const Gr={couldNotLoadContentForSS:"Could not load content for {PH1} ({PH2})"},Kr=s.i18n.registerUIStrings("core/sdk/CompilerSourceMappingContentProvider.ts",Gr),$r=s.i18n.getLocalizedString.bind(void 0,Kr);var Qr,Xr,Jr=Object.freeze({__proto__:null,CompilerSourceMappingContentProvider:class{#so;#io;#ao;constructor(e,t,n){this.#so=e,this.#io=t,this.#ao=n}contentURL(){return this.#so}contentType(){return this.#io}async requestContent(){try{const{content:e}=await Ht.instance().loadResource(this.#so,this.#ao);return{content:e,isEncoded:!1}}catch(e){const t=$r(Gr.couldNotLoadContentForSS,{PH1:this.#so,PH2:e.message});return console.error(t),{content:null,error:t,isEncoded:!1}}}async searchInContent(e,t,n){const{content:s}=await this.requestContent();return"string"!=typeof s?[]:r.TextUtils.performSearchInContent(s,e,t,n)}}});!function(e){e.Result="result",e.Command="command",e.System="system",e.QueryObjectResult="queryObjectResult"}(Qr||(Qr={})),function(e){e.CSS="css",e.ConsoleAPI="console-api"}(Xr||(Xr={}));const Yr={profileD:"Profile {PH1}"},Zr=s.i18n.registerUIStrings("core/sdk/CPUProfilerModel.ts",Yr),es=s.i18n.getLocalizedString.bind(void 0,Zr);class ts extends c{#oo;#lo;#do;#co;#ho;#uo;registeredConsoleProfileMessages=[];constructor(e){super(e),this.#oo=!1,this.#lo=1,this.#do=new Map,this.#co=e.profilerAgent(),this.#ho=null,e.registerProfilerDispatcher(this),this.#co.invoke_enable(),this.#uo=e.model(or)}runtimeModel(){return this.#uo.runtimeModel()}debuggerModel(){return this.#uo}consoleProfileStarted({id:e,location:t,title:n}){n||(n=es(Yr.profileD,{PH1:this.#lo++}),this.#do.set(e,n));const r=this.createEventDataFrom(e,t,n);this.dispatchEventToListeners(ns.ConsoleProfileStarted,r)}consoleProfileFinished({id:e,location:t,profile:n,title:r}){r||(r=this.#do.get(e),this.#do.delete(e));const s={...this.createEventDataFrom(e,t,r),cpuProfile:n};this.registeredConsoleProfileMessages.push(s),this.dispatchEventToListeners(ns.ConsoleProfileFinished,s)}createEventDataFrom(e,t,n){const r=ur.fromPayload(this.#uo,t);return{id:this.target().id()+"."+e,scriptLocation:r,title:n||"",cpuProfilerModel:this}}isRecordingProfile(){return this.#oo}startRecording(){this.#oo=!0;return this.#co.invoke_setSamplingInterval({interval:100}),this.#co.invoke_start()}stopRecording(){return this.#oo=!1,this.#co.invoke_stop().then((e=>e.profile||null))}startPreciseCoverage(e,t){this.#ho=t;return this.#co.invoke_startPreciseCoverage({callCount:!1,detailed:e,allowTriggeredUpdates:!0})}async takePreciseCoverage(){const e=await this.#co.invoke_takePreciseCoverage();return{timestamp:e&&e.timestamp||0,coverage:e&&e.result||[]}}stopPreciseCoverage(){return this.#ho=null,this.#co.invoke_stopPreciseCoverage()}preciseCoverageDeltaUpdate({timestamp:e,occasion:t,result:n}){this.#ho&&this.#ho(e,t,n)}}var ns;!function(e){e.ConsoleProfileStarted="ConsoleProfileStarted",e.ConsoleProfileFinished="ConsoleProfileFinished"}(ns||(ns={})),c.register(ts,{capabilities:z.JS,autostart:!0});var rs,ss=Object.freeze({__proto__:null,CPUProfilerModel:ts,get Events(){return ns}});class is extends c{#go;constructor(e){super(e),e.registerLogDispatcher(this),this.#go=e.logAgent(),this.#go.invoke_enable(),i.InspectorFrontendHost.isUnderTest()||this.#go.invoke_startViolationsReport({config:[{name:"longTask",threshold:200},{name:"longLayout",threshold:30},{name:"blockedEvent",threshold:100},{name:"blockedParser",threshold:-1},{name:"handler",threshold:150},{name:"recurringHandler",threshold:50},{name:"discouragedAPIUse",threshold:-1}]})}entryAdded({entry:e}){this.dispatchEventToListeners(rs.EntryAdded,{logModel:this,entry:e})}requestClear(){this.#go.invoke_clear()}}(rs||(rs={})).EntryAdded="EntryAdded",c.register(is,{capabilities:z.Log,autostart:!0});var as=Object.freeze({__proto__:null,LogModel:is,get Events(){return rs}});const os={navigatedToS:"Navigated to {PH1}",bfcacheNavigation:"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)",profileSStarted:"Profile ''{PH1}'' started.",profileSFinished:"Profile ''{PH1}'' finished.",failedToSaveToTempVariable:"Failed to save to temp variable."},ls=s.i18n.registerUIStrings("core/sdk/ConsoleModel.ts",os),ds=s.i18n.getLocalizedString.bind(void 0,ls);class cs extends c{#po;#mo;#fo;#bo;#yo;#vo;#Io;#ko;constructor(n){super(n),this.#po=[],this.#mo=new t.MapUtilities.Multimap,this.#fo=new Map,this.#bo=0,this.#yo=0,this.#vo=0,this.#Io=0,this.#ko=new WeakMap;const r=n.model(jn);if(!r||r.cachedResourcesLoaded())return void this.initTarget(n);const s=r.addEventListener(_n.CachedResourcesLoaded,(()=>{e.EventTarget.removeEventListeners([s]),this.initTarget(n)}))}initTarget(e){const t=[],n=e.model(ts);n&&(t.push(n.addEventListener(ns.ConsoleProfileStarted,this.consoleProfileStarted.bind(this,n))),t.push(n.addEventListener(ns.ConsoleProfileFinished,this.consoleProfileFinished.bind(this,n))));const r=e.model(jn);r&&e.parentTarget()?.type()!==_.Frame&&t.push(r.addEventListener(_n.PrimaryPageChanged,this.primaryPageChanged,this));const s=e.model(Cr);s&&(t.push(s.addEventListener(Rr.ExceptionThrown,this.exceptionThrown.bind(this,s))),t.push(s.addEventListener(Rr.ExceptionRevoked,this.exceptionRevoked.bind(this,s))),t.push(s.addEventListener(Rr.ConsoleAPICalled,this.consoleAPICalled.bind(this,s))),e.parentTarget()?.type()!==_.Frame&&t.push(s.debuggerModel().addEventListener(cr.GlobalObjectCleared,this.clearIfNecessary,this)),t.push(s.addEventListener(Rr.QueryObjectRequested,this.queryObjectRequested.bind(this,s)))),this.#ko.set(e,t)}targetRemoved(t){const n=t.model(Cr);n&&this.#fo.delete(n),e.EventTarget.removeEventListeners(this.#ko.get(t)||[])}async evaluateCommandInConsole(t,n,r,s){const a=await t.evaluate({expression:r,objectGroup:"console",includeCommandLineAPI:s,silent:!1,returnByValue:!1,generatePreview:!0,replMode:!0,allowUnsafeEvalBlockedByCSP:!1},e.Settings.Settings.instance().moduleSetting("consoleUserActivationEval").get(),!1);i.userMetrics.actionTaken(i.UserMetrics.Action.ConsoleEvaluated),"error"in a||(await e.Console.Console.instance().showPromise(),this.dispatchEventToListeners(hs.CommandEvaluated,{result:a.object,commandMessage:n,exceptionDetails:a.exceptionDetails}))}addCommandMessage(e,t){const n=new gs(e.runtimeModel,"javascript",null,t,{type:Qr.Command});return n.setExecutionContextId(e.id),this.addMessage(n),n}addMessage(e){e.setPageLoadSequenceNumber(this.#Io),e.source===Xr.ConsoleAPI&&"clear"===e.type&&this.clearIfNecessary(),this.#po.push(e),this.#mo.set(e.timestamp,e);const t=e.runtimeModel(),n=e.getExceptionId();if(n&&t){let r=this.#fo.get(t);r||(r=new Map,this.#fo.set(t,r)),r.set(n,e)}this.incrementErrorWarningCount(e),this.dispatchEventToListeners(hs.MessageAdded,e)}exceptionThrown(e,t){const n=t.data,r=function(e){if(!e)return;return{requestId:e.requestId||void 0,issueId:e.issueId||void 0}}(n.details.exceptionMetaData),s=gs.fromException(e,n.details,void 0,n.timestamp,void 0,r);s.setExceptionId(n.details.exceptionId),this.addMessage(s)}exceptionRevoked(e,t){const n=t.data,r=this.#fo.get(e),s=r?r.get(n):null;s&&(this.#yo--,s.level="verbose",this.dispatchEventToListeners(hs.MessageUpdated,s))}consoleAPICalled(e,t){const n=t.data;let r="info";"debug"===n.type?r="verbose":"error"===n.type||"assert"===n.type?r="error":"warning"===n.type?r="warning":"info"!==n.type&&"log"!==n.type||(r="info");let s="";n.args.length&&n.args[0].unserializableValue?s=n.args[0].unserializableValue:!n.args.length||"object"==typeof n.args[0].value&&null!==n.args[0].value?n.args.length&&n.args[0].description&&(s=n.args[0].description):s=String(n.args[0].value);const i=n.stackTrace&&n.stackTrace.callFrames.length?n.stackTrace.callFrames[0]:null,a={type:n.type,url:i?.url,line:i?.lineNumber,column:i?.columnNumber,parameters:n.args,stackTrace:n.stackTrace,timestamp:n.timestamp,executionContextId:n.executionContextId,context:n.context},o=new gs(e,Xr.ConsoleAPI,r,s,a);for(const e of this.#mo.get(o.timestamp).values())if(o.isEqual(e))return;this.addMessage(o)}queryObjectRequested(e,t){const{objects:n,executionContextId:r}=t.data,s={type:Qr.QueryObjectResult,parameters:[n],executionContextId:r},i=new gs(e,Xr.ConsoleAPI,"info","",s);this.addMessage(i)}clearIfNecessary(){e.Settings.Settings.instance().moduleSetting("preserveConsoleLog").get()||this.clear(),++this.#Io}primaryPageChanged(t){if(e.Settings.Settings.instance().moduleSetting("preserveConsoleLog").get()){const{frame:n}=t.data;n.backForwardCacheDetails.restoredFromCache?e.Console.Console.instance().log(ds(os.bfcacheNavigation,{PH1:n.url})):e.Console.Console.instance().log(ds(os.navigatedToS,{PH1:n.url}))}}consoleProfileStarted(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profile",n.scriptLocation,ds(os.profileSStarted,{PH1:n.title}))}consoleProfileFinished(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profileEnd",n.scriptLocation,ds(os.profileSFinished,{PH1:n.title}))}addConsoleProfileMessage(e,t,n,r){const s=n.script(),i=[{functionName:"",scriptId:n.scriptId,url:s?s.contentURL():"",lineNumber:n.lineNumber,columnNumber:n.columnNumber||0}];this.addMessage(new gs(e.runtimeModel(),Xr.ConsoleAPI,"info",r,{type:t,stackTrace:{callFrames:i}}))}incrementErrorWarningCount(e){if("violation"!==e.source)switch(e.level){case"warning":this.#bo++;break;case"error":this.#yo++}else this.#vo++}messages(){return this.#po}static allMessagesUnordered(){const e=[];for(const t of K.instance().targets()){const n=t.model(cs)?.messages()||[];e.push(...n)}return e}static requestClearMessages(){for(const e of K.instance().models(is))e.requestClear();for(const e of K.instance().models(Cr))e.discardConsoleEntries();for(const e of K.instance().targets())e.model(cs)?.clear()}clear(){this.#po=[],this.#mo.clear(),this.#fo.clear(),this.#yo=0,this.#bo=0,this.#vo=0,this.dispatchEventToListeners(hs.ConsoleCleared)}errors(){return this.#yo}static allErrors(){let e=0;for(const t of K.instance().targets())e+=t.model(cs)?.errors()||0;return e}warnings(){return this.#bo}static allWarnings(){let e=0;for(const t of K.instance().targets())e+=t.model(cs)?.warnings()||0;return e}violations(){return this.#vo}static allViolations(){let e=0;for(const t of K.instance().targets())e+=t.model(cs)?.violations()||0;return e}async saveToTempVariable(t,n){if(!n||!t)return void o(null);const r=t,s=await r.globalObject("",!1);if("error"in s||Boolean(s.exceptionDetails)||!s.object)return void o("object"in s&&s.object||null);const i=s.object,a=await i.callFunction((function(e){const t="temp";let n=1;for(;t+n in this;)++n;const r=t+n;return this[r]=e,r}),[Le.toCallArgument(n)]);if(i.release(),a.wasThrown||!a.object||"string"!==a.object.type)o(a.object||null);else{const e=a.object.value,t=this.addCommandMessage(r,e);this.evaluateCommandInConsole(r,t,e,!1)}function o(t){let n=ds(os.failedToSaveToTempVariable);t&&(n=n+" "+t.description),e.Console.Console.instance().error(n)}a.object&&a.object.release()}}var hs;function us(e,t){if(!e!=!t)return!1;if(!e||!t)return!0;const n=e.callFrames,r=t.callFrames;if(n.length!==r.length)return!1;for(let e=0,t=n.length;e<t;++e)if(n[e].scriptId!==r[e].scriptId||n[e].functionName!==r[e].functionName||n[e].lineNumber!==r[e].lineNumber||n[e].columnNumber!==r[e].columnNumber)return!1;return us(e.parent,t.parent)}!function(e){e.ConsoleCleared="ConsoleCleared",e.MessageAdded="MessageAdded",e.MessageUpdated="MessageUpdated",e.CommandEvaluated="CommandEvaluated"}(hs||(hs={}));class gs{#ba;source;level;messageText;type;url;line;column;parameters;stackTrace;timestamp;#So;scriptId;workerId;context;#wo=null;#Io=void 0;#Co=void 0;#To;category;stackFrameWithBreakpoint=null;#Ro=null;constructor(e,t,n,r,s){if(this.#ba=e,this.source=t,this.level=n,this.messageText=r,this.type=s?.type||"log",this.url=s?.url,this.line=s?.line||0,this.column=s?.column||0,this.parameters=s?.parameters,this.stackTrace=s?.stackTrace,this.timestamp=s?.timestamp||Date.now(),this.#So=s?.executionContextId||0,this.scriptId=s?.scriptId,this.workerId=s?.workerId,this.#To=s?.affectedResources,this.category=s?.category,!this.#So&&this.#ba&&(this.scriptId?this.#So=this.#ba.executionContextIdForScriptId(this.scriptId):this.stackTrace&&(this.#So=this.#ba.executionContextForStackTrace(this.stackTrace))),s?.context){const e=s?.context.match(/[^#]*/);this.context=e?.[0]}if(this.stackTrace){const{callFrame:e,type:t}=gs.#xo(this.stackTrace);this.stackFrameWithBreakpoint=e,this.#Ro=t}}getAffectedResources(){return this.#To}setPageLoadSequenceNumber(e){this.#Io=e}static fromException(e,t,n,r,s,i){const a={type:n,url:s||t.url,line:t.lineNumber,column:t.columnNumber,parameters:t.exception?[Le.fromLocalObject(t.text),t.exception]:void 0,stackTrace:t.stackTrace,timestamp:r,executionContextId:t.executionContextId,scriptId:t.scriptId,affectedResources:i};return new gs(e,"javascript","error",Cr.simpleTextFromException(t),a)}runtimeModel(){return this.#ba}target(){return this.#ba?this.#ba.target():null}setOriginatingMessage(e){this.#wo=e,this.#So=e.#So}originatingMessage(){return this.#wo}setExecutionContextId(e){this.#So=e}getExecutionContextId(){return this.#So}getExceptionId(){return this.#Co}setExceptionId(e){this.#Co=e}isGroupMessage(){return"startGroup"===this.type||"startGroupCollapsed"===this.type||"endGroup"===this.type}isGroupStartMessage(){return"startGroup"===this.type||"startGroupCollapsed"===this.type}isErrorOrWarning(){return"warning"===this.level||"error"===this.level}isGroupable(){const e="error"===this.level&&("javascript"===this.source||"network"===this.source);return this.source!==Xr.ConsoleAPI&&this.type!==Qr.Command&&this.type!==Qr.Result&&this.type!==Qr.System&&!e}groupCategoryKey(){return[this.source,this.level,this.type,this.#Io].join(":")}isEqual(e){if(!e)return!1;if(this.parameters){if(!e.parameters||this.parameters.length!==e.parameters.length)return!1;for(let t=0;t<e.parameters.length;++t){const n=e.parameters[t],r=this.parameters[t];if("string"==typeof n||"string"==typeof r)return!1;if("object"===n.type&&"error"!==n.subtype)return!1;if(r.type!==n.type||r.value!==n.value||r.description!==n.description)return!1}}return this.runtimeModel()===e.runtimeModel()&&this.source===e.source&&this.type===e.type&&this.level===e.level&&this.line===e.line&&this.url===e.url&&this.scriptId===e.scriptId&&this.messageText===e.messageText&&this.#So===e.#So&&(t=this.#To,n=e.#To,t?.requestId===n?.requestId)&&us(this.stackTrace,e.stackTrace);var t,n}get originatesFromLogpoint(){return"LOGPOINT"===this.#Ro}get originatesFromConditionalBreakpoint(){return"CONDITIONAL_BREAKPOINT"===this.#Ro}static#xo({callFrames:e}){const t=[yr,br],n=e.findLastIndex((({url:e})=>t.includes(e)));if(-1===n||n===e.length-1)return{callFrame:null,type:null};const r=e[n].url===br?"LOGPOINT":"CONDITIONAL_BREAKPOINT";return{callFrame:e[n+1],type:r}}}c.register(cs,{capabilities:z.JS,autostart:!0});const ps=new Map([["xml","xml"],["javascript","javascript"],["network","network"],[Xr.ConsoleAPI,"console-api"],["storage","storage"],["appcache","appcache"],["rendering","rendering"],[Xr.CSS,"css"],["security","security"],["deprecation","deprecation"],["worker","worker"],["violation","violation"],["intervention","intervention"],["recommendation","recommendation"],["other","other"]]);var ms=Object.freeze({__proto__:null,ConsoleModel:cs,get Events(){return hs},ConsoleMessage:gs,MessageSourceDisplayName:ps,get FrontendMessageSource(){return Xr},get FrontendMessageType(){return Qr}});class fs extends c{#Mo;#Po;constructor(e){super(e),this.#Mo=new Map,this.#Po=new Map}addBlockedCookie(e,t){const n=e.key(),r=this.#Mo.get(n);this.#Mo.set(n,e),t?this.#Po.set(e,t):this.#Po.delete(e),r&&this.#Po.delete(r)}getCookieToBlockedReasonsMap(){return this.#Po}async getCookies(e){const t=await this.target().networkAgent().invoke_getCookies({urls:e});if(t.getError())return[];return t.cookies.map(F.fromProtocolCookie).concat(Array.from(this.#Mo.values()))}async deleteCookie(e){await this.deleteCookies([e])}async clear(e,t){const n=await this.getCookiesForDomain(e||null);if(t){const e=n.filter((e=>e.matchesSecurityOrigin(t)));await this.deleteCookies(e)}else await this.deleteCookies(n)}async saveCookie(e){let t,n=e.domain();n.startsWith(".")||(n=""),e.expires()&&(t=Math.floor(Date.parse(`${e.expires()}`)/1e3));const r=o.Runtime.experiments.isEnabled("experimentalCookieFeatures"),s={name:e.name(),value:e.value(),url:e.url()||void 0,domain:n,path:e.path(),secure:e.secure(),httpOnly:e.httpOnly(),sameSite:e.sameSite(),expires:t,priority:e.priority(),partitionKey:e.partitionKey(),sourceScheme:r?e.sourceScheme():(i=e.sourceScheme(),"Unset"===i?i:void 0),sourcePort:r?e.sourcePort():void 0};var i;const a=await this.target().networkAgent().invoke_setCookie(s);return!(a.getError()||!a.success)&&a.success}getCookiesForDomain(t){const n=[];const r=this.target().model(jn);return r&&(r.mainFrame&&r.mainFrame.unreachableUrl()&&n.push(r.mainFrame.unreachableUrl()),r.forAllResources((function(r){const s=e.ParsedURL.ParsedURL.fromString(r.documentURL);return!s||t&&s.securityOrigin()!==t||n.push(r.url),!1}))),this.getCookies(n)}async deleteCookies(e){const t=this.target().networkAgent();this.#Mo.clear(),this.#Po.clear(),await Promise.all(e.map((e=>t.invoke_deleteCookies({name:e.name(),url:void 0,domain:e.domain(),path:e.path()}))))}}c.register(fs,{capabilities:z.Network,autostart:!1});var bs=Object.freeze({__proto__:null,CookieModel:fs});class ys extends A{id;self;positionTicks;deoptReason;constructor(e,t,n){super(e.callFrame||{functionName:e.functionName,scriptId:e.scriptId,url:e.url,lineNumber:e.lineNumber-1,columnNumber:e.columnNumber-1},n),this.id=e.id,this.self=(e.hitCount||0)*t,this.positionTicks=e.positionTicks,this.deoptReason=e.deoptReason&&"no reason"!==e.deoptReason?e.deoptReason:null}}var vs=Object.freeze({__proto__:null,CPUProfileNode:ys,CPUProfileDataModel:class extends O{profileStartTime;profileEndTime;timestamps;samples;lines;totalHitCount;profileHead;#Lo;gcNode;programNode;idleNode;#Eo;#Ao;constructor(e,t){super(t);Boolean(e.head)?(this.profileStartTime=1e3*e.startTime,this.profileEndTime=1e3*e.endTime,this.timestamps=e.timestamps,this.compatibilityConversionHeadToNodes(e)):(this.profileStartTime=e.startTime/1e3,this.profileEndTime=e.endTime/1e3,this.timestamps=this.convertTimeDeltas(e)),this.samples=e.samples,this.lines=e.lines,this.totalHitCount=0,this.profileHead=this.translateProfileTree(e.nodes),this.initialize(this.profileHead),this.extractMetaNodes(),this.samples&&(this.sortSamples(),this.normalizeTimestamps(),this.fixMissingSamples())}compatibilityConversionHeadToNodes(e){if(!e.head||e.nodes)return;const t=[];!function e(n){return t.push(n),n.children=n.children.map(e),n.id}(e.head),e.nodes=t,delete e.head}convertTimeDeltas(e){if(!e.timeDeltas)return[];let t=e.startTime;const n=new Array(e.timeDeltas.length);for(let r=0;r<e.timeDeltas.length;++r)t+=e.timeDeltas[r],n[r]=t;return n}translateProfileTree(t){const n=new Map;for(let e=0;e<t.length;++e){const r=t[e];n.set(r.id,r)}!function(e,t){if("number"!=typeof e[0].hitCount){if(!t)throw new Error("Error: Neither hitCount nor samples are present in profile.");for(let t=0;t<e.length;++t)e[t].hitCount=0;for(let e=0;e<t.length;++e){const r=n.get(t[e]);r&&void 0!==r.hitCount&&r.hitCount++}}}(t,this.samples),function(e){if(!e[0].children){e[0].children=[];for(let t=1;t<e.length;++t){const r=e[t],s=n.get(r.parent);s.children?s.children.push(r.id):s.children=[r.id]}}}(t),this.totalHitCount=t.reduce(((e,t)=>e+(t.hitCount||0)),0);const r=(this.profileEndTime-this.profileStartTime)/this.totalHitCount,s=Boolean(e.Settings.Settings.instance().moduleSetting("showNativeFunctionsInJSProfile").get()),i=t[0],a=new Map([[i.id,i.id]]);this.#Lo=new Map;const o=new ys(i,r,this.target());if(this.#Lo.set(i.id,o),!i.children)throw new Error("Missing children for root");const l=i.children.map((()=>o)),d=i.children.map((e=>n.get(e)));for(;d.length;){let e=l.pop();const t=d.pop();if(!t||!e)continue;t.children||(t.children=[]);const i=new ys(t,r,this.target());s||!((c=t).callFrame?Boolean(c.callFrame.url)&&c.callFrame.url.startsWith("native "):Boolean(c.url)&&c.url.startsWith("native "))?(e.children.push(i),e=i):e.self+=i.self,a.set(t.id,e.id),l.push.apply(l,t.children.map((()=>e))),d.push.apply(d,t.children.map((e=>n.get(e)))),this.#Lo.set(t.id,i)}var c;return this.samples&&(this.samples=this.samples.map((e=>a.get(e)))),o}sortSamples(){if(!this.timestamps||!this.samples)return;const e=this.timestamps,t=this.samples,n=e.map(((e,t)=>t));n.sort(((t,n)=>e[t]-e[n])),this.timestamps=[],this.samples=[];for(let r=0;r<n.length;r++){const s=n[r];this.timestamps.push(e[s]),this.samples.push(t[s])}}normalizeTimestamps(){if(!this.samples)return;let e=this.timestamps;if(e){for(let t=0;t<e.length;++t)e[t]/=1e3;if(this.samples.length===e.length){const t=e.at(-1)||0,n=(t-e[0])/(e.length-1);this.timestamps.push(t+n)}this.profileStartTime=e.at(0)||this.profileStartTime,this.profileEndTime=e.at(-1)||this.profileEndTime}else{const t=this.profileStartTime,n=(this.profileEndTime-t)/this.samples.length;e=new Float64Array(this.samples.length+1);for(let r=0;r<e.length;++r)e[r]=t+r*n;this.timestamps=e}}extractMetaNodes(){const e=this.profileHead.children;for(let t=0;t<e.length&&!(this.gcNode&&this.programNode&&this.idleNode);t++){const n=e[t];"(garbage collector)"===n.functionName?this.gcNode=n:"(program)"===n.functionName?this.programNode=n:"(idle)"===n.functionName&&(this.idleNode=n)}}fixMissingSamples(){const e=this.samples;if(!e)return;const t=e.length;if(!this.programNode||t<3)return;const n=this.#Lo,r=this.programNode.id,s=this.gcNode?this.gcNode.id:-1,i=this.idleNode?this.idleNode.id:-1;let a=e[0],o=e[1];for(let s=1;s<t-1;s++){const t=e[s+1];o!==r||d(a)||d(t)||l(n.get(a))!==l(n.get(t))||(e[s]=a),a=o,o=t}function l(e){for(;e.parent&&e.parent.parent;)e=e.parent;return e}function d(e){return e===r||e===s||e===i}}forEachFrame(e,n,r,s){if(!this.profileHead||!this.samples)return;r=r||0,s=s||1/0;const i=this.samples,a=this.timestamps,o=this.#Lo,l=this.gcNode,d=i.length,c=t.ArrayUtilities.lowerBound(a,r,t.ArrayUtilities.DEFAULT_COMPARATOR);let h=0;const u=[];let g,p=this.profileHead.id,m=null;const f=this.maxDepth+3;this.#Eo||(this.#Eo=new Float64Array(f));const b=this.#Eo;this.#Ao||(this.#Ao=new Float64Array(f));const y=this.#Ao;let v,I;for(I=c;I<d&&(g=a[I],!(g>=s));I++){const t=i[I];if(t===p)continue;v=o.get(t);let r=o.get(p);if(v!==l){if(r===l&&m){const e=b[h],t=g-e;y[h-1]+=t,n(m.depth+1,l,e,t,t-y[h]),--h,r=m,p=r.id,m=null}for(;v&&v.depth>r.depth;)u.push(v),v=v.parent;for(;r!==v;){const e=b[h],t=g-e;y[h-1]+=t,n(r.depth,r,e,t,t-y[h]),--h,v&&v.depth===r.depth&&(u.push(v),v=v.parent),r=r.parent}for(;u.length;){const t=u.pop();v=t,e(t.depth,t,g),b[++h]=g,y[h]=0}p=t}else m=r,e(m.depth+1,l,g),b[++h]=g,y[h]=0,p=t}if(g=a[I]||this.profileEndTime,m&&o.get(p)===l){const e=b[h],t=g-e;y[h-1]+=t,n(m.depth+1,v,e,t,t-y[h]),--h,p=m.id}for(let e=o.get(p);e&&e.parent;e=e.parent){const t=b[h],r=g-t;y[h-1]+=r,n(e.depth,e,t,r,r-y[h]),--h}}nodeByIndex(e){return this.samples&&this.#Lo.get(this.samples[e])||null}nodes(){return this.#Lo?[...this.#Lo.values()]:null}}});class Is extends c{#Oo;#No;#jr;#Fo;#Bo;#Do;#Uo;#Ho;#qo;#_o;constructor(t){super(t),this.#Oo=t.emulationAgent(),this.#No=t.deviceOrientationAgent(),this.#jr=t.model(en),this.#Fo=t.model(vn),this.#Fo&&this.#Fo.addEventListener(In.InspectModeWillBeToggled,(()=>{this.updateTouch()}),this);const n=e.Settings.Settings.instance().moduleSetting("javaScriptDisabled");n.addChangeListener((async()=>await this.#Oo.invoke_setScriptExecutionDisabled({value:n.get()}))),n.get()&&this.#Oo.invoke_setScriptExecutionDisabled({value:!0});const r=e.Settings.Settings.instance().moduleSetting("emulation.touch");r.addChangeListener((()=>{const e=r.get();this.overrideEmulateTouch("force"===e)}));const s=e.Settings.Settings.instance().moduleSetting("emulation.idleDetection");s.addChangeListener((async()=>{const e=s.get();if("none"===e)return void await this.clearIdleOverride();const t=JSON.parse(e);await this.setIdleOverride(t)}));const i=e.Settings.Settings.instance().moduleSetting("emulatedCSSMedia"),a=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeatureColorGamut"),o=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeaturePrefersColorScheme"),l=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeatureForcedColors"),d=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeaturePrefersContrast"),c=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeaturePrefersReducedData"),h=e.Settings.Settings.instance().moduleSetting("emulatedCSSMediaFeaturePrefersReducedMotion");this.#Bo=new Map([["type",i.get()],["color-gamut",a.get()],["prefers-color-scheme",o.get()],["forced-colors",l.get()],["prefers-contrast",d.get()],["prefers-reduced-data",c.get()],["prefers-reduced-motion",h.get()]]),i.addChangeListener((()=>{this.#Bo.set("type",i.get()),this.updateCssMedia()})),a.addChangeListener((()=>{this.#Bo.set("color-gamut",a.get()),this.updateCssMedia()})),o.addChangeListener((()=>{this.#Bo.set("prefers-color-scheme",o.get()),this.updateCssMedia()})),l.addChangeListener((()=>{this.#Bo.set("forced-colors",l.get()),this.updateCssMedia()})),d.addChangeListener((()=>{this.#Bo.set("prefers-contrast",d.get()),this.updateCssMedia()})),c.addChangeListener((()=>{this.#Bo.set("prefers-reduced-data",c.get()),this.updateCssMedia()})),h.addChangeListener((()=>{this.#Bo.set("prefers-reduced-motion",h.get()),this.updateCssMedia()})),this.updateCssMedia();const u=e.Settings.Settings.instance().moduleSetting("emulateAutoDarkMode");u.addChangeListener((()=>{const e=u.get();o.setDisabled(e),o.set(e?"dark":""),this.emulateAutoDarkMode(e)})),u.get()&&(o.setDisabled(!0),o.set("dark"),this.emulateAutoDarkMode(!0));const g=e.Settings.Settings.instance().moduleSetting("emulatedVisionDeficiency");g.addChangeListener((()=>this.emulateVisionDeficiency(g.get()))),g.get()&&this.emulateVisionDeficiency(g.get());const p=e.Settings.Settings.instance().moduleSetting("localFontsDisabled");p.addChangeListener((()=>this.setLocalFontsDisabled(p.get()))),p.get()&&this.setLocalFontsDisabled(p.get());const m=e.Settings.Settings.instance().moduleSetting("avifFormatDisabled"),f=e.Settings.Settings.instance().moduleSetting("webpFormatDisabled"),b=()=>{const e=[];m.get()&&e.push("avif"),f.get()&&e.push("webp"),this.setDisabledImageTypes(e)};m.addChangeListener(b),f.addChangeListener(b),(m.get()||f.get())&&b(),this.#Ho=!0,this.#Do=!1,this.#Uo=!1,this.#qo=!1,this.#_o={enabled:!1,configuration:"mobile"}}setTouchEmulationAllowed(e){this.#Ho=e}supportsDeviceEmulation(){return this.target().hasAllCapabilities(z.DeviceEmulation)}async resetPageScaleFactor(){await this.#Oo.invoke_resetPageScaleFactor()}async emulateDevice(e){e?await this.#Oo.invoke_setDeviceMetricsOverride(e):await this.#Oo.invoke_clearDeviceMetricsOverride()}overlayModel(){return this.#Fo}async emulateLocation(e){if(!e||e.error)await Promise.all([this.#Oo.invoke_clearGeolocationOverride(),this.#Oo.invoke_setTimezoneOverride({timezoneId:""}),this.#Oo.invoke_setLocaleOverride({locale:""}),this.#Oo.invoke_setUserAgentOverride({userAgent:ue.instance().currentUserAgent()})]);else{function t(e,t){const n=t.getError();return n?Promise.reject({type:e,message:n}):Promise.resolve()}await Promise.all([this.#Oo.invoke_setGeolocationOverride({latitude:e.latitude,longitude:e.longitude,accuracy:ks.defaultGeoMockAccuracy}).then((e=>t("emulation-set-location",e))),this.#Oo.invoke_setTimezoneOverride({timezoneId:e.timezoneId}).then((e=>t("emulation-set-timezone",e))),this.#Oo.invoke_setLocaleOverride({locale:e.locale}).then((e=>t("emulation-set-locale",e))),this.#Oo.invoke_setUserAgentOverride({userAgent:ue.instance().currentUserAgent(),acceptLanguage:e.locale}).then((e=>t("emulation-set-user-agent",e)))])}}async emulateDeviceOrientation(e){e?await this.#No.invoke_setDeviceOrientationOverride({alpha:e.alpha,beta:e.beta,gamma:e.gamma}):await this.#No.invoke_clearDeviceOrientationOverride()}async setIdleOverride(e){await this.#Oo.invoke_setIdleOverride(e)}async clearIdleOverride(){await this.#Oo.invoke_clearIdleOverride()}async emulateCSSMedia(e,t){await this.#Oo.invoke_setEmulatedMedia({media:e,features:t}),this.#jr&&this.#jr.mediaQueryResultChanged()}async emulateAutoDarkMode(e){e&&(this.#Bo.set("prefers-color-scheme","dark"),await this.updateCssMedia()),await this.#Oo.invoke_setAutoDarkModeOverride({enabled:e||void 0})}async emulateVisionDeficiency(e){await this.#Oo.invoke_setEmulatedVisionDeficiency({type:e})}setLocalFontsDisabled(e){this.#jr&&this.#jr.setLocalFontsEnabled(!e)}setDisabledImageTypes(e){this.#Oo.invoke_setDisabledImageTypes({imageTypes:e})}async setCPUThrottlingRate(e){await this.#Oo.invoke_setCPUThrottlingRate({rate:e})}async setHardwareConcurrency(e){if(e<1)throw new Error("hardwareConcurrency must be a positive value");await this.#Oo.invoke_setHardwareConcurrencyOverride({hardwareConcurrency:e})}async emulateTouch(e,t){this.#Do=e&&this.#Ho,this.#Uo=t&&this.#Ho,await this.updateTouch()}async overrideEmulateTouch(e){this.#qo=e&&this.#Ho,await this.updateTouch()}async updateTouch(){let e={enabled:this.#Do,configuration:this.#Uo?"mobile":"desktop"};this.#qo&&(e={enabled:!0,configuration:"mobile"}),this.#Fo&&this.#Fo.inspectModeEnabled()&&(e={enabled:!1,configuration:"mobile"}),(this.#_o.enabled||e.enabled)&&(this.#_o.enabled&&e.enabled&&this.#_o.configuration===e.configuration||(this.#_o=e,await this.#Oo.invoke_setTouchEmulationEnabled({enabled:e.enabled,maxTouchPoints:1}),await this.#Oo.invoke_setEmitTouchEventsForMouse({enabled:e.enabled,configuration:e.configuration})))}async updateCssMedia(){const e=this.#Bo.get("type")??"",t=[{name:"color-gamut",value:this.#Bo.get("color-gamut")??""},{name:"prefers-color-scheme",value:this.#Bo.get("prefers-color-scheme")??""},{name:"forced-colors",value:this.#Bo.get("forced-colors")??""},{name:"prefers-contrast",value:this.#Bo.get("prefers-contrast")??""},{name:"prefers-reduced-data",value:this.#Bo.get("prefers-reduced-data")??""},{name:"prefers-reduced-motion",value:this.#Bo.get("prefers-reduced-motion")??""}];return this.emulateCSSMedia(e,t)}}class ks{latitude;longitude;timezoneId;locale;error;constructor(e,t,n,r,s){this.latitude=e,this.longitude=t,this.timezoneId=n,this.locale=r,this.error=s}static parseSetting(e){if(e){const[t,n,r,s]=e.split(":"),[i,a]=t.split("@");return new ks(parseFloat(i),parseFloat(a),n,r,Boolean(s))}return new ks(0,0,"","",!1)}static parseUserInput(e,t,n,r){if(!e&&!t)return null;const{valid:s}=ks.latitudeValidator(e),{valid:i}=ks.longitudeValidator(t);if(!s&&!i)return null;const a=s?parseFloat(e):-1,o=i?parseFloat(t):-1;return new ks(a,o,n,r,!1)}static latitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-90&&t<=90,errorMessage:void 0}}static longitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-180&&t<=180,errorMessage:void 0}}static timezoneIdValidator(e){return{valid:""===e||/[a-zA-Z]/.test(e),errorMessage:void 0}}static localeValidator(e){return{valid:""===e||/[a-zA-Z]{2}/.test(e),errorMessage:void 0}}toSetting(){return`${this.latitude}@${this.longitude}:${this.timezoneId}:${this.locale}:${this.error||""}`}static defaultGeoMockAccuracy=150}class Ss{alpha;beta;gamma;constructor(e,t,n){this.alpha=e,this.beta=t,this.gamma=n}static parseSetting(e){if(e){const t=JSON.parse(e);return new Ss(t.alpha,t.beta,t.gamma)}return new Ss(0,0,0)}static parseUserInput(e,t,n){if(!e&&!t&&!n)return null;const{valid:r}=Ss.alphaAngleValidator(e),{valid:s}=Ss.betaAngleValidator(t),{valid:i}=Ss.gammaAngleValidator(n);if(!r&&!s&&!i)return null;const a=r?parseFloat(e):-1,o=s?parseFloat(t):-1,l=i?parseFloat(n):-1;return new Ss(a,o,l)}static angleRangeValidator(e,t){const n=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&n>=t.minimum&&n<t.maximum,errorMessage:void 0}}static alphaAngleValidator(e){return Ss.angleRangeValidator(e,{minimum:-180,maximum:180})}static betaAngleValidator(e){return Ss.angleRangeValidator(e,{minimum:-180,maximum:180})}static gammaAngleValidator(e){return Ss.angleRangeValidator(e,{minimum:-90,maximum:90})}toSetting(){return JSON.stringify(this)}}c.register(Is,{capabilities:z.Emulation,autostart:!0});var ws=Object.freeze({__proto__:null,EmulationModel:Is,Location:ks,DeviceOrientation:Ss});let Cs;class Ts extends e.ObjectWrapper.ObjectWrapper{#zo;#jo;#Wo;constructor(){super(),this.#zo=xs.NoThrottling,K.instance().observeModels(Is,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return Cs&&!t||(Cs=new Ts),Cs}cpuThrottlingRate(){return this.#zo}setCPUThrottlingRate(e){this.#zo=e;for(const e of K.instance().models(Is))e.setCPUThrottlingRate(this.#zo);this.dispatchEventToListeners(Rs.RateChanged,this.#zo)}setHardwareConcurrency(e){this.#jo=e;for(const t of K.instance().models(Is))t.setHardwareConcurrency(e);this.dispatchEventToListeners(Rs.HardwareConcurrencyChanged,this.#jo)}hasPrimaryPageTargetSet(){try{return null!==K.instance().primaryPageTarget()}catch{return!1}}async getHardwareConcurrency(){const e=K.instance().primaryPageTarget(),t=this.#Wo;if(!e)return new Promise(t?e=>{this.#Wo=n=>{e(n),t(n)}}:e=>{this.#Wo=e});const n=await e.runtimeAgent().invoke_evaluate({expression:"navigator.hardwareConcurrency",returnByValue:!0,silent:!0,throwOnSideEffect:!0}),r=n.getError();if(r)throw new Error(r);const{result:s,exceptionDetails:i}=n;if(i)throw new Error(i.text);return s.value}modelAdded(e){if(this.#zo!==xs.NoThrottling&&e.setCPUThrottlingRate(this.#zo),void 0!==this.#jo&&e.setHardwareConcurrency(this.#jo),this.#Wo){const e=this.#Wo;this.#Wo=void 0,this.getHardwareConcurrency().then(e)}}modelRemoved(e){}}var Rs,xs;!function(e){e.RateChanged="RateChanged",e.HardwareConcurrencyChanged="HardwareConcurrencyChanged"}(Rs||(Rs={})),function(e){e[e.NoThrottling=1]="NoThrottling",e[e.MidTierMobile=4]="MidTierMobile",e[e.LowEndMobile=6]="LowEndMobile"}(xs||(xs={}));var Ms=Object.freeze({__proto__:null,CPUThrottlingManager:Ts,get Events(){return Rs},throttlingManager:function(){return Ts.instance()},get CPUThrottlingRates(){return xs}});const Ps=new Set(["inherit","initial","unset"]),Ls=/[\x20-\x7E]{4}/,Es=new RegExp(`(?:'(${Ls.source})')|(?:"(${Ls.source})")\\s+(${/[+-]?(?:\d*\.)?\d+(?:[eE]\d+)?/.source})`);const As=/^"(.+)"|'(.+)'$/;function Os(e){return e.split(",").map((e=>e.trim()))}function Ns(e){return e.replaceAll(/(\/\*(?:.|\s)*?\*\/)/g,"")}var Fs=Object.freeze({__proto__:null,parseFontVariationSettings:function(e){if(Ps.has(e.trim())||"normal"===e.trim())return[];const t=[];for(const n of Os(Ns(e))){const e=n.match(Es);e&&t.push({tag:e[1]||e[2],value:parseFloat(e[3])})}return t},parseFontFamily:function(e){if(Ps.has(e.trim()))return[];const t=[];for(const n of Os(Ns(e))){const e=n.match(As);e?t.push(e[1]||e[2]):t.push(n)}return t},splitByComma:Os,stripComments:Ns});const Bs={trustedTypeViolations:"Trusted Type Violations",sinkViolations:"Sink Violations",policyViolations:"Policy Violations",animation:"Animation",canvas:"Canvas",geolocation:"Geolocation",notification:"Notification",parse:"Parse",script:"Script",timer:"Timer",window:"Window",webaudio:"WebAudio",media:"Media",pictureinpicture:"Picture-in-Picture",clipboard:"Clipboard",control:"Control",device:"Device",domMutation:"DOM Mutation",dragDrop:"Drag / drop",keyboard:"Keyboard",load:"Load",mouse:"Mouse",pointer:"Pointer",touch:"Touch",xhr:"XHR",setTimeoutOrIntervalFired:"{PH1} fired",scriptFirstStatement:"Script First Statement",scriptBlockedByContentSecurity:"Script Blocked by Content Security Policy",requestAnimationFrame:"Request Animation Frame",cancelAnimationFrame:"Cancel Animation Frame",animationFrameFired:"Animation Frame Fired",webglErrorFired:"WebGL Error Fired",webglWarningFired:"WebGL Warning Fired",setInnerhtml:"Set `innerHTML`",createCanvasContext:"Create canvas context",createAudiocontext:"Create `AudioContext`",closeAudiocontext:"Close `AudioContext`",resumeAudiocontext:"Resume `AudioContext`",suspendAudiocontext:"Suspend `AudioContext`",webglErrorFiredS:"WebGL Error Fired ({PH1})",scriptBlockedDueToContent:"Script blocked due to Content Security Policy directive: {PH1}",worker:"Worker"},Ds=s.i18n.registerUIStrings("core/sdk/DOMDebuggerModel.ts",Bs),Us=s.i18n.getLocalizedString.bind(void 0,Ds);class Hs extends c{agent;#ba;#Mr;#Vo;#Go;suspended=!1;constructor(t){super(t),this.agent=t.domdebuggerAgent(),this.#ba=t.model(Cr),this.#Mr=t.model(Pn),this.#Mr.addEventListener(wn.DocumentUpdated,this.documentUpdated,this),this.#Mr.addEventListener(wn.NodeRemoved,this.nodeRemoved,this),this.#Vo=[],this.#Go=e.Settings.Settings.instance().createLocalSetting("domBreakpoints",[]),this.#Mr.existingDocument()&&this.documentUpdated()}runtimeModel(){return this.#ba}async suspendModel(){this.suspended=!0}async resumeModel(){this.suspended=!1}async eventListeners(e){if(console.assert(e.runtimeModel()===this.#ba),!e.objectId)return[];const t=await this.agent.invoke_getEventListeners({objectId:e.objectId}),n=[];for(const r of t.listeners||[]){const t=this.#ba.debuggerModel().createRawLocationByScriptId(r.scriptId,r.lineNumber,r.columnNumber);t&&n.push(new js(this,e,r.type,r.useCapture,r.passive,r.once,r.handler?this.#ba.createRemoteObject(r.handler):null,r.originalHandler?this.#ba.createRemoteObject(r.originalHandler):null,t,null))}return n}retrieveDOMBreakpoints(){this.#Mr.requestDocument()}domBreakpoints(){return this.#Vo.slice()}hasDOMBreakpoint(e,t){return this.#Vo.some((n=>n.node===e&&n.type===t))}setDOMBreakpoint(e,t){for(const n of this.#Vo)if(n.node===e&&n.type===t)return this.toggleDOMBreakpoint(n,!0),n;const n=new zs(this,e,t,!0);return this.#Vo.push(n),this.saveDOMBreakpoints(),this.enableDOMBreakpoint(n),this.dispatchEventToListeners(qs.DOMBreakpointAdded,n),n}removeDOMBreakpoint(e,t){this.removeDOMBreakpoints((n=>n.node===e&&n.type===t))}removeAllDOMBreakpoints(){this.removeDOMBreakpoints((e=>!0))}toggleDOMBreakpoint(e,t){t!==e.enabled&&(e.enabled=t,t?this.enableDOMBreakpoint(e):this.disableDOMBreakpoint(e),this.dispatchEventToListeners(qs.DOMBreakpointToggled,e))}enableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_setDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(_s,!0))}disableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_removeDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(_s,!!this.nodeHasBreakpoints(e.node)||null))}nodeHasBreakpoints(e){for(const t of this.#Vo)if(t.node===e&&t.enabled)return!0;return!1}resolveDOMBreakpointData(e){const t=e.type,n=this.#Mr.nodeForId(e.nodeId);if(!t||!n)return null;let r=null,s=!1;return"subtree-modified"===t&&(s=e.insertion||!1,r=this.#Mr.nodeForId(e.targetNodeId)),{type:t,node:n,targetNode:r,insertion:s}}currentURL(){const e=this.#Mr.existingDocument();return e?e.documentURL:t.DevToolsPath.EmptyUrlString}async documentUpdated(){if(this.suspended)return;const e=this.#Vo;this.#Vo=[],this.dispatchEventToListeners(qs.DOMBreakpointsRemoved,e);const n=await this.#Mr.requestDocument(),r=n?n.documentURL:t.DevToolsPath.EmptyUrlString;for(const e of this.#Go.get())e.url===r&&this.#Mr.pushNodeByPathToFrontend(e.path).then(s.bind(this,e));function s(e,t){const n=t?this.#Mr.nodeForId(t):null;if(!n)return;const r=new zs(this,n,e.type,e.enabled);this.#Vo.push(r),e.enabled&&this.enableDOMBreakpoint(r),this.dispatchEventToListeners(qs.DOMBreakpointAdded,r)}}removeDOMBreakpoints(e){const t=[],n=[];for(const r of this.#Vo)e(r)?(t.push(r),r.enabled&&(r.enabled=!1,this.disableDOMBreakpoint(r))):n.push(r);t.length&&(this.#Vo=n,this.saveDOMBreakpoints(),this.dispatchEventToListeners(qs.DOMBreakpointsRemoved,t))}nodeRemoved(e){if(this.suspended)return;const{node:t}=e.data,n=t.children()||[];this.removeDOMBreakpoints((e=>e.node===t||-1!==n.indexOf(e.node)))}saveDOMBreakpoints(){const e=this.currentURL(),t=this.#Go.get().filter((t=>t.url!==e));for(const n of this.#Vo)t.push({url:e,path:n.node.path(),type:n.type,enabled:n.enabled});this.#Go.set(t)}}var qs;!function(e){e.DOMBreakpointAdded="DOMBreakpointAdded",e.DOMBreakpointToggled="DOMBreakpointToggled",e.DOMBreakpointsRemoved="DOMBreakpointsRemoved"}(qs||(qs={}));const _s="breakpoint-marker";class zs{domDebuggerModel;node;type;enabled;constructor(e,t,n,r){this.domDebuggerModel=e,this.node=t,this.type=n,this.enabled=r}}class js{#Ko;#$o;#p;#Qo;#Xo;#Jo;#Yo;#Zo;#na;#el;#tl;#nl;constructor(e,n,r,s,i,a,o,l,d,c,h){this.#Ko=e,this.#$o=n,this.#p=r,this.#Qo=s,this.#Xo=i,this.#Jo=a,this.#Yo=o,this.#Zo=l||o,this.#na=d;const u=d.script();this.#el=u?u.contentURL():t.DevToolsPath.EmptyUrlString,this.#tl=c,this.#nl=h||js.Origin.Raw}domDebuggerModel(){return this.#Ko}type(){return this.#p}useCapture(){return this.#Qo}passive(){return this.#Xo}once(){return this.#Jo}handler(){return this.#Yo}location(){return this.#na}sourceURL(){return this.#el}originalHandler(){return this.#Zo}canRemove(){return Boolean(this.#tl)||this.#nl!==js.Origin.FrameworkUser}remove(){if(!this.canRemove())return Promise.resolve(void 0);if(this.#nl!==js.Origin.FrameworkUser){function e(e,t,n){this.removeEventListener(e,t,n),this["on"+e]&&(this["on"+e]=void 0)}return this.#$o.callFunction(e,[Le.toCallArgument(this.#p),Le.toCallArgument(this.#Zo),Le.toCallArgument(this.#Qo)]).then((()=>{}))}if(this.#tl){function e(e,t,n,r){this.call(null,e,t,n,r)}return this.#tl.callFunction(e,[Le.toCallArgument(this.#p),Le.toCallArgument(this.#Zo),Le.toCallArgument(this.#Qo),Le.toCallArgument(this.#Xo)]).then((()=>{}))}return Promise.resolve(void 0)}canTogglePassive(){return this.#nl!==js.Origin.FrameworkUser}togglePassive(){return this.#$o.callFunction((function(e,t,n,r){this.removeEventListener(e,t,{capture:n}),this.addEventListener(e,t,{capture:n,passive:!r})}),[Le.toCallArgument(this.#p),Le.toCallArgument(this.#Zo),Le.toCallArgument(this.#Qo),Le.toCallArgument(this.#Xo)]).then((()=>{}))}origin(){return this.#nl}markAsFramework(){this.#nl=js.Origin.Framework}isScrollBlockingType(){return"touchstart"===this.#p||"touchmove"===this.#p||"mousewheel"===this.#p||"wheel"===this.#p}}!function(e){let t;!function(e){e.Raw="Raw",e.Framework="Framework",e.FrameworkUser="FrameworkUser"}(t=e.Origin||(e.Origin={}))}(js||(js={}));class Ws extends Fr{#p;constructor(e,t,n){super(e,t),this.#p=n}type(){return this.#p}}class Vs extends Fr{instrumentationName;eventName;eventTargetNames;constructor(e,t,n,r,s){super(r,s),this.instrumentationName=e,this.eventName=t,this.eventTargetNames=n}setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of K.instance().models(Hs))this.updateOnModel(e)}}updateOnModel(e){if(this.instrumentationName)this.enabled()?e.agent.invoke_setInstrumentationBreakpoint({eventName:this.instrumentationName}):e.agent.invoke_removeInstrumentationBreakpoint({eventName:this.instrumentationName});else for(const t of this.eventTargetNames)this.enabled()?e.agent.invoke_setEventListenerBreakpoint({eventName:this.eventName,targetName:t}):e.agent.invoke_removeEventListenerBreakpoint({eventName:this.eventName,targetName:t})}static listener="listener:";static instrumentation="instrumentation:"}let Gs;class Ks{#rl;#sl;#il;#al;constructor(){this.#rl=e.Settings.Settings.instance().createLocalSetting("xhrBreakpoints",[]),this.#sl=new Map;for(const e of this.#rl.get())this.#sl.set(e.url,e.enabled);this.#il=[],this.#il.push(new Ws(Us(Bs.trustedTypeViolations),Us(Bs.sinkViolations),"trustedtype-sink-violation")),this.#il.push(new Ws(Us(Bs.trustedTypeViolations),Us(Bs.policyViolations),"trustedtype-policy-violation")),this.#al=[],this.createInstrumentationBreakpoints(Us(Bs.animation),["requestAnimationFrame","cancelAnimationFrame","requestAnimationFrame.callback"]),this.createInstrumentationBreakpoints(Us(Bs.canvas),["canvasContextCreated","webglErrorFired","webglWarningFired"]),this.createInstrumentationBreakpoints(Us(Bs.geolocation),["Geolocation.getCurrentPosition","Geolocation.watchPosition"]),this.createInstrumentationBreakpoints(Us(Bs.notification),["Notification.requestPermission"]),this.createInstrumentationBreakpoints(Us(Bs.parse),["Element.setInnerHTML","Document.write"]),this.createInstrumentationBreakpoints(Us(Bs.script),["scriptFirstStatement","scriptBlockedByCSP"]),this.createInstrumentationBreakpoints(Us(Bs.timer),["setTimeout","clearTimeout","setInterval","clearInterval","setTimeout.callback","setInterval.callback"]),this.createInstrumentationBreakpoints(Us(Bs.window),["DOMWindow.close"]),this.createInstrumentationBreakpoints(Us(Bs.webaudio),["audioContextCreated","audioContextClosed","audioContextResumed","audioContextSuspended"]),this.createEventListenerBreakpoints(Us(Bs.media),["play","pause","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange","loadstart","progress","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","waiting"],["audio","video"]),this.createEventListenerBreakpoints(Us(Bs.pictureinpicture),["enterpictureinpicture","leavepictureinpicture"],["video"]),this.createEventListenerBreakpoints(Us(Bs.pictureinpicture),["resize"],["PictureInPictureWindow"]),this.createEventListenerBreakpoints(Us(Bs.pictureinpicture),["enter"],["documentPictureInPicture"]),this.createEventListenerBreakpoints(Us(Bs.clipboard),["copy","cut","paste","beforecopy","beforecut","beforepaste"],["*"]),this.createEventListenerBreakpoints(Us(Bs.control),["resize","scroll","scrollend","zoom","focus","blur","select","change","submit","reset"],["*"]),this.createEventListenerBreakpoints(Us(Bs.device),["deviceorientation","devicemotion"],["*"]),this.createEventListenerBreakpoints(Us(Bs.domMutation),["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"],["*"]),this.createEventListenerBreakpoints(Us(Bs.dragDrop),["drag","dragstart","dragend","dragenter","dragover","dragleave","drop"],["*"]),this.createEventListenerBreakpoints(Us(Bs.keyboard),["keydown","keyup","keypress","input"],["*"]),this.createEventListenerBreakpoints(Us(Bs.load),["load","beforeunload","unload","abort","error","hashchange","popstate","navigate","navigatesuccess","navigateerror","currentchange","navigateto","navigatefrom","finish","dispose"],["*"]),this.createEventListenerBreakpoints(Us(Bs.mouse),["auxclick","click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mouseenter","mouseleave","mousewheel","wheel","contextmenu"],["*"]),this.createEventListenerBreakpoints(Us(Bs.pointer),["pointerover","pointerout","pointerenter","pointerleave","pointerdown","pointerup","pointermove","pointercancel","gotpointercapture","lostpointercapture","pointerrawupdate"],["*"]),this.createEventListenerBreakpoints(Us(Bs.touch),["touchstart","touchmove","touchend","touchcancel"],["*"]),this.createEventListenerBreakpoints(Us(Bs.worker),["message","messageerror"],["*"]),this.createEventListenerBreakpoints(Us(Bs.xhr),["readystatechange","load","loadstart","loadend","abort","error","progress","timeout"],["xmlhttprequest","xmlhttprequestupload"]);for(const[e,t]of[["setTimeout.callback",Us(Bs.setTimeoutOrIntervalFired,{PH1:"setTimeout"})],["setInterval.callback",Us(Bs.setTimeoutOrIntervalFired,{PH1:"setInterval"})],["scriptFirstStatement",Us(Bs.scriptFirstStatement)],["scriptBlockedByCSP",Us(Bs.scriptBlockedByContentSecurity)],["requestAnimationFrame",Us(Bs.requestAnimationFrame)],["cancelAnimationFrame",Us(Bs.cancelAnimationFrame)],["requestAnimationFrame.callback",Us(Bs.animationFrameFired)],["webglErrorFired",Us(Bs.webglErrorFired)],["webglWarningFired",Us(Bs.webglWarningFired)],["Element.setInnerHTML",Us(Bs.setInnerhtml)],["canvasContextCreated",Us(Bs.createCanvasContext)],["Geolocation.getCurrentPosition","getCurrentPosition"],["Geolocation.watchPosition","watchPosition"],["Notification.requestPermission","requestPermission"],["DOMWindow.close","window.close"],["Document.write","document.write"],["audioContextCreated",Us(Bs.createAudiocontext)],["audioContextClosed",Us(Bs.closeAudiocontext)],["audioContextResumed",Us(Bs.resumeAudiocontext)],["audioContextSuspended",Us(Bs.suspendAudiocontext)]]){const n=this.resolveEventListenerBreakpointInternal("instrumentation:"+e);n&&n.setTitle(t)}K.instance().observeModels(Hs,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return Gs&&!t||(Gs=new Ks),Gs}cspViolationBreakpoints(){return this.#il.slice()}createInstrumentationBreakpoints(e,t){for(const n of t)this.#al.push(new Vs(n,"",[],e,n))}createEventListenerBreakpoints(e,t,n){for(const r of t)this.#al.push(new Vs("",r,n,e,r))}resolveEventListenerBreakpointInternal(e,t){const n="instrumentation:",r="listener:";let s="";if(e.startsWith(n))s=e.substring(n.length),e="";else{if(!e.startsWith(r))return null;e=e.substring(r.length)}t=(t||"*").toLowerCase();let i=null;for(const n of this.#al)s&&n.instrumentationName===s&&(i=n),e&&n.eventName===e&&-1!==n.eventTargetNames.indexOf(t)&&(i=n),!i&&e&&n.eventName===e&&-1!==n.eventTargetNames.indexOf("*")&&(i=n);return i}eventListenerBreakpoints(){return this.#al.slice()}resolveEventListenerBreakpointTitle(e){const t=e.eventName;if("instrumentation:webglErrorFired"===t&&e.webglErrorName){let t=e.webglErrorName;return t=t.replace(/^.*(0x[0-9a-f]+).*$/i,"$1"),Us(Bs.webglErrorFiredS,{PH1:t})}if("instrumentation:scriptBlockedByCSP"===t&&e.directiveText)return Us(Bs.scriptBlockedDueToContent,{PH1:e.directiveText});const n=this.resolveEventListenerBreakpointInternal(t,e.targetName);return n?e.targetName?e.targetName+"."+n.title():n.title():""}resolveEventListenerBreakpoint(e){return this.resolveEventListenerBreakpointInternal(e.eventName,e.targetName)}updateCSPViolationBreakpoints(){const e=this.#il.filter((e=>e.enabled())).map((e=>e.type()));for(const t of K.instance().models(Hs))this.updateCSPViolationBreakpointsForModel(t,e)}updateCSPViolationBreakpointsForModel(e,t){e.agent.invoke_setBreakOnCSPViolation({violationTypes:t})}xhrBreakpoints(){return this.#sl}saveXHRBreakpoints(){const e=[];for(const t of this.#sl.keys())e.push({url:t,enabled:this.#sl.get(t)||!1});this.#rl.set(e)}addXHRBreakpoint(e,t){if(this.#sl.set(e,t),t)for(const t of K.instance().models(Hs))t.agent.invoke_setXHRBreakpoint({url:e});this.saveXHRBreakpoints()}removeXHRBreakpoint(e){const t=this.#sl.get(e);if(this.#sl.delete(e),t)for(const t of K.instance().models(Hs))t.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}toggleXHRBreakpoint(e,t){this.#sl.set(e,t);for(const n of K.instance().models(Hs))t?n.agent.invoke_setXHRBreakpoint({url:e}):n.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}modelAdded(e){for(const t of this.#sl.keys())this.#sl.get(t)&&e.agent.invoke_setXHRBreakpoint({url:t});for(const t of this.#al)t.enabled()&&t.updateOnModel(e);const t=this.#il.filter((e=>e.enabled())).map((e=>e.type()));this.updateCSPViolationBreakpointsForModel(e,t)}modelRemoved(e){}}c.register(Hs,{capabilities:z.DOM,autostart:!1});var $s=Object.freeze({__proto__:null,DOMDebuggerModel:Hs,get Events(){return qs},DOMBreakpoint:zs,get EventListener(){return js},CSPViolationBreakpoint:Ws,DOMEventListenerBreakpoint:Vs,DOMDebuggerManager:Ks});const Qs={auctionWorklet:"Ad Auction Worklet",beforeBidderWorkletBiddingStart:"Bidder Bidding Phase Start",beforeBidderWorkletReportingStart:"Bidder Reporting Phase Start",beforeSellerWorkletScoringStart:"Seller Scoring Phase Start",beforeSellerWorkletReportingStart:"Seller Reporting Phase Start"},Xs=s.i18n.registerUIStrings("core/sdk/EventBreakpointsModel.ts",Qs),Js=s.i18n.getLocalizedString.bind(void 0,Xs);class Ys extends c{agent;constructor(e){super(e),this.agent=e.eventBreakpointsAgent()}}class Zs extends Fr{instrumentationName;constructor(e,t){super(t,function(e){switch(e){case"beforeBidderWorkletBiddingStart":return Js(Qs.beforeBidderWorkletBiddingStart);case"beforeBidderWorkletReportingStart":return Js(Qs.beforeBidderWorkletReportingStart);case"beforeSellerWorkletScoringStart":return Js(Qs.beforeSellerWorkletScoringStart);case"beforeSellerWorkletReportingStart":return Js(Qs.beforeSellerWorkletReportingStart)}}(e)),this.instrumentationName=e}setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of K.instance().models(Ys))this.updateOnModel(e)}}updateOnModel(e){this.enabled()?e.agent.invoke_setInstrumentationBreakpoint({eventName:this.instrumentationName}):e.agent.invoke_removeInstrumentationBreakpoint({eventName:this.instrumentationName})}static instrumentationPrefix="instrumentation:"}let ei;class ti{#al=[];constructor(){this.createInstrumentationBreakpoints(Js(Qs.auctionWorklet),["beforeBidderWorkletBiddingStart","beforeBidderWorkletReportingStart","beforeSellerWorkletScoringStart","beforeSellerWorkletReportingStart"]),K.instance().observeModels(Ys,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return ei&&!t||(ei=new ti),ei}createInstrumentationBreakpoints(e,t){for(const n of t)this.#al.push(new Zs(n,e))}eventListenerBreakpoints(){return this.#al.slice()}resolveEventListenerBreakpointTitle(e){const t=this.resolveEventListenerBreakpoint(e);return t?t.title():null}resolveEventListenerBreakpoint(e){const t=e.eventName;if(!t.startsWith(Zs.instrumentationPrefix))return null;const n=t.substring(Zs.instrumentationPrefix.length);return this.#al.find((e=>e.instrumentationName===n))||null}modelAdded(e){for(const t of this.#al)t.enabled()&&t.updateOnModel(e)}modelRemoved(e){}}c.register(Ys,{capabilities:z.EventBreakpoints,autostart:!1});var ni=Object.freeze({__proto__:null,EventBreakpointsModel:Ys,EventBreakpointsManager:ti});class ri{#ol;#ll;#dl;#cl;#hl;#ul;#gl;#pl;#ml;#fl;#bl;#yl;#vl=[];constructor(e){this.#ol=e,this.#ll=new Map,this.#dl=new Map,this.#cl=Number(1/0),this.#hl=Number(-1/0),this.#ul=[],this.#gl=[],this.#pl=new Map,this.#ml=new Map,this.#fl=new Map,this.#bl=new Map,this.#yl=new Map}static isTopLevelEvent(e){return vi(e,li)&&"RunTask"===e.name||vi(e,ai)||vi(e,oi)&&"Program"===e.name}static extractId(e){const t=e.scope||"";if(void 0===e.id2)return t&&e.id?`${t}@${e.id}`:e.id;const n=e.id2;if("object"==typeof n&&"global"in n!="local"in n)return void 0!==n.global?`:${t}:${n.global}`:`:${t}:${e.pid}:${n.local}`;console.error(`Unexpected id2 field at ${e.ts/1e3}, one and only one of 'local' and 'global' should be present.`)}static browserMainThread(t){const n=t.sortedProcesses();if(!n.length)return null;const r="CrBrowserMain",s=[],i=[];for(const e of n)e.name().toLowerCase().endsWith("browser")&&s.push(e),i.push(...e.sortedThreads().filter((e=>e.name()===r)));if(1===i.length)return i[0];if(1===s.length)return s[0].threadByName(r);const a=t.devToolsMetadataEvents().filter((e=>"TracingStartedInBrowser"===e.name));return 1===a.length?a[0].thread:(e.Console.Console.instance().error("Failed to find browser main thread in trace, some timeline features may be unavailable"),null)}allRawEvents(){return this.#vl}devToolsMetadataEvents(){return this.#ul}addEvents(e){for(let t=0;t<e.length;++t)this.addEvent(e[t])}tracingComplete(){this.processPendingAsyncEvents();for(const e of this.#ll.values())for(const t of e.threads.values())t.tracingComplete()}addEvent(e){this.#vl.push(e);let t=this.#ll.get(e.pid);t||(t=new fi(this,e.pid),this.#ll.set(e.pid,t));const n=e.ts/1e3;if(n&&n<this.#cl&&si.has(e.ph)&&!e.name.endsWith("::UMA")&&(this.#cl=n),"TracingStartedInBrowser"===e.name&&(this.#cl=n),"navigationStart"===e.name){const n=e.args.data;if(n){const{isLoadingMainFrame:r,documentLoaderURL:s,navigationId:i,isOutermostMainFrame:a}=n;if((a??r)&&""!==s){const n=t.threadById(e.tid),r=hi.fromPayload(e,n);this.#yl.set(i,r)}}}if(si.has(e.ph)){const t=(e.ts+(e.dur||0))/1e3;this.#hl=Math.max(this.#hl,t)}const r=t.addEvent(e);if(r)if("P"!==e.ph){if(l.Types.TraceEvents.isAsyncPhase(e.ph)&&this.#gl.push(r),r.hasCategory(oi)&&this.#ul.push(r),"M"===e.ph)switch(e.name){case ii.ProcessSortIndex:t.setSortIndex(e.args.sort_index);break;case ii.ProcessName:{const n=e.args.name;t.setName(n),this.#dl.set(n,t);break}case ii.ThreadSortIndex:t.threadById(e.tid).setSortIndex(e.args.sort_index);break;case ii.ThreadName:t.threadById(e.tid).setName(e.args.name)}}else this.addSampleEvent(r)}addSampleEvent(e){const t=`${e.thread.process().id()}:${e.id}`,n=this.#fl.get(t);n?n.addChild(e):this.#fl.set(t,new pi(e))}profileGroup(e){return this.#fl.get(`${e.thread.process().id()}:${e.id}`)||null}minimumRecordTime(){return this.#cl}maximumRecordTime(){return this.#hl}navStartTimes(){return this.#yl}sortedProcesses(){return mi.sort([...this.#ll.values()])}getProcessByName(e){return this.#dl.get(e)??null}getProcessById(e){return this.#ll.get(e)||null}getThreadByName(e,t){const n=this.getProcessByName(e);return n&&n.threadByName(t)}processPendingAsyncEvents(){this.#gl.sort(di.compareStartTime);for(let e=0;e<this.#gl.length;++e){const t=this.#gl[e];l.Types.TraceEvents.isNestableAsyncPhase(t.phase)?this.addNestableAsyncEvent(t):this.addAsyncEvent(t)}this.#gl=[],this.closeOpenAsyncEvents()}closeOpenAsyncEvents(){for(const e of this.#pl.values())e.setEndTime(this.#hl),e.steps[0].setEndTime(this.#hl);this.#pl.clear();for(const e of this.#ml.values())for(;e.length;){const t=e.pop();t&&t.setEndTime(this.#hl)}this.#ml.clear()}addNestableAsyncEvent(e){const t=e.categoriesString+"."+e.id;let n=this.#ml.get(t);switch(e.phase){case"b":{n||(n=[],this.#ml.set(t,n));const r=new gi(e);n.push(r),e.thread.addAsyncEvent(r);break}case"n":if(n&&n.length){const e=n[n.length-1];e&&e.addStep(e)}break;case"e":{if(!n||!n.length)break;const r=n.pop();if(!r)break;if(r.name!==e.name){console.error(`Begin/end event mismatch for nestable async event, ${r.name} vs. ${e.name}, key: ${t}`);break}r.addStep(e)}}}addAsyncEvent(e){const t=e.categoriesString+"."+e.name+"."+e.id;let n=this.#pl.get(t);if("S"===e.phase)return n?void console.error(`Event ${e.name} has already been started`):(n=new gi(e),this.#pl.set(t,n),void e.thread.addAsyncEvent(n));if(n){if("F"===e.phase)return n.addStep(e),void this.#pl.delete(t);if("T"===e.phase||"p"===e.phase){const t=n.steps[n.steps.length-1];return t&&"S"!==t.phase&&t.phase!==e.phase?void console.assert(!1,"Async event step phase mismatch: "+t.phase+" at "+t.startTime+" vs. "+e.phase+" at "+e.startTime):void n.addStep(e)}console.assert(!1,"Invalid async event phase")}}title(){return this.#ol}parsedCategoriesForString(e){let t=this.#bl.get(e);return t||(t=new Set(e?e.split(","):[]),this.#bl.set(e,t)),t}}const si=new Set(["B","E","X","I"]),ii={ProcessSortIndex:"process_sort_index",ProcessName:"process_name",ThreadSortIndex:"thread_sort_index",ThreadName:"thread_name"},ai="toplevel",oi="disabled-by-default-devtools.timeline",li="disabled-by-default-devtools.timeline";class di{categoriesString;#bl;name;phase;startTime;thread;args;id;ordinal;selfTime;endTime;duration;constructor(e,t,n,r,s){this.categoriesString=e||"",this.#bl=s.getModel().parsedCategoriesForString(this.categoriesString),this.name=t,this.phase=n,this.startTime=r,this.thread=s,this.args={},this.ordinal=0,this.selfTime=0}static compareStartTime(e,t){return e&&t?e.startTime-t.startTime:0}static orderedCompareStartTime(e,t){return e.startTime-t.startTime||e.ordinal-t.ordinal||-1}hasCategory(e){return this.#bl.has(e)}setEndTime(e){e<this.startTime?console.assert(!1,"Event out of order: "+this.name):(this.endTime=e,this.duration=e-this.startTime)}addArgs(e){for(const t in e)t in this.args&&console.error("Same argument name ("+t+") is used for begin and end phases of "+this.name),this.args[t]=e[t]}complete(e){e.args?this.addArgs(e.args):console.error("Missing mandatory event argument 'args' at "+e.startTime),this.setEndTime(e.startTime)}}class ci extends di{constructor(e,t,n,r,s){super(e,t,n,r,s)}}class hi extends di{#Il;rawLegacyPayload(){return this.#Il}rawPayload(){return this.#Il}constructor(e,t,n,r,s,i){super(e,t,n,r,s),this.#Il=i}static fromPayload(e,t){const n=new hi(e.cat,e.name,e.ph,e.ts/1e3,t,e);n.#Il=e,e.args&&n.addArgs(e.args),"number"==typeof e.dur&&n.setEndTime((e.ts+e.dur)/1e3);const r=ri.extractId(e);return void 0!==r&&(n.id=r),n}}class ui extends hi{constructor(e,t,n,r,s){super(e,t,"O",n,r,s)}static fromPayload(e,t){const n=new ui(e.cat,e.name,e.ts/1e3,t,e),r=ri.extractId(e);return void 0!==r&&(n.id=r),e.args&&e.args.snapshot?(e.args&&n.addArgs(e.args),n):(console.error("Missing mandatory 'snapshot' argument at "+e.ts/1e3),n)}getSnapshot(){const e=this.args.snapshot;if(!e)throw new Error("ObjectSnapshot has no snapshot argument.");return e}}class gi extends ci{steps;causedFrame;constructor(e){super(e.categoriesString,e.name,e.phase,e.startTime,e.thread),this.addArgs(e.args),this.steps=[e],this.causedFrame=!1}addStep(e){this.steps.push(e),"F"!==e.phase&&"e"!==e.phase||(this.setEndTime(e.startTime),this.steps[0].setEndTime(e.startTime))}}class pi{children;constructor(e){this.children=[e]}addChild(e){this.children.push(e)}}class mi{model;idInternal;#u;#kl;constructor(e,t){this.model=e,this.idInternal=t,this.#u="",this.#kl=0}static sort(e){return e.sort(((e,t)=>e.#kl!==t.#kl?e.#kl-t.#kl:e.name().localeCompare(t.name())))}setName(e){this.#u=e}name(){return this.#u}id(){return this.idInternal}setSortIndex(e){this.#kl=e}getModel(){return this.model}}class fi extends mi{threads;#Sl;constructor(e,t){super(e,t),this.threads=new Map,this.#Sl=new Map}threadById(e){let t=this.threads.get(e);return t||(t=new bi(this,e),this.threads.set(e,t)),t}threadByName(e){return this.#Sl.get(e)||null}setThreadByName(e,t){this.#Sl.set(e,t)}addEvent(e){return this.threadById(e.tid).addEvent(e)}sortedThreads(){return mi.sort([...this.threads.values()])}}class bi extends mi{#wl;#Cl;#Tl;#Rl;constructor(e,t){super(e.getModel(),t),this.#wl=e,this.#Cl=[],this.#Tl=[],this.#Rl=null}#xl(e,t){return e.phase===t}tracingComplete(){this.#Tl.sort(di.compareStartTime),this.#Cl.sort(di.compareStartTime);const e=[],t=new Set;for(let n=0;n<this.#Cl.length;++n){const r=this.#Cl[n];if(r.ordinal=n,this.#xl(r,"E")){if(t.add(n),!e.length)continue;const s=e.pop();if(!s)continue;s.name!==r.name||s.categoriesString!==r.categoriesString?console.error("B/E events mismatch at "+s.startTime+" ("+s.name+") vs. "+r.startTime+" ("+r.name+")"):s.complete(r)}else this.#xl(r,"B")&&e.push(r)}for(;e.length;){const t=e.pop();t&&(t.phase="I")}this.#Cl=this.#Cl.filter(((e,n)=>!t.has(n)))}addEvent(e){const t="O"===e.ph?ui.fromPayload(e,this):hi.fromPayload(e,this);if(ri.isTopLevelEvent(t)){const e=this.#Rl;if(e&&(e.endTime||0)>t.startTime)return null;this.#Rl=t}return this.#Cl.push(t),t}addAsyncEvent(e){this.#Tl.push(e)}setName(e){super.setName(e),this.#wl.setThreadByName(e,this)}process(){return this.#wl}events(){return this.#Cl}asyncEvents(){return this.#Tl}removeEventsByName(e){const t=[];return this.#Cl=this.#Cl.filter((n=>!!n&&(n.name!==e||(t.push(n),!1)))),t}}const yi=new Map;function vi(e,t){if(e instanceof di)return e.hasCategory(t);let n=yi.get(e.cat);return n||(n=new Set(e.cat.split(",")||[])),n.has(t)}var Ii=Object.freeze({__proto__:null,TracingModel:ri,eventPhasesOfInterestForTraceBounds:si,MetadataEvent:ii,LegacyTopLevelEventCategory:ai,DevToolsMetadataEventCategory:oi,DevToolsTimelineEventCategory:li,eventHasPayload:function(e){return"rawPayload"in e},Event:di,ConstructedEvent:ci,PayloadEvent:hi,ObjectSnapshot:ui,AsyncEvent:gi,Process:fi,Thread:bi,timesForEventInMilliseconds:function(e){if(e instanceof di)return{startTime:l.Types.Timing.MilliSeconds(e.startTime),endTime:e.endTime?l.Types.Timing.MilliSeconds(e.endTime):void 0,duration:l.Types.Timing.MilliSeconds(e.duration||0),selfTime:l.Types.Timing.MilliSeconds(e.selfTime)};const t=e.dur?l.Helpers.Timing.microSecondsToMilliseconds(e.dur):l.Types.Timing.MilliSeconds(0);return{startTime:l.Helpers.Timing.microSecondsToMilliseconds(e.ts),endTime:l.Helpers.Timing.microSecondsToMilliseconds(l.Types.Timing.MicroSeconds(e.ts+(e.dur||0))),duration:e.dur?l.Helpers.Timing.microSecondsToMilliseconds(e.dur):l.Types.Timing.MilliSeconds(0),selfTime:t}},eventHasCategory:vi,phaseForEvent:function(e){return e instanceof di?e.phase:e.ph},threadIDForEvent:function(e){return e instanceof di?e.thread.idInternal:e.tid},eventIsFromNewEngine:function(e){return null!==e&&!(e instanceof di)}});const ki="disabled-by-default-devtools.screenshot",Si={Screenshot:"Screenshot"};class wi{#Ml;timestamp;index;#Pl;#Ll;constructor(e,t,n){this.#Ml=e,this.timestamp=t,this.index=n,this.#Ll=null,this.#Pl=null}static fromSnapshot(e,t,n){const r=new wi(e,t.startTime,n);return r.#Pl=t,r}static fromTraceEvent(e,t,n){const r=l.Helpers.Timing.microSecondsToMilliseconds(t.ts),s=new wi(e,r,n);return s.#Ll=t,s}model(){return this.#Ml}imageDataPromise(){return this.#Ll?Promise.resolve(this.#Ll.args.snapshot):this.#Pl?Promise.resolve(this.#Pl.getSnapshot()):Promise.resolve(null)}}var Ci=Object.freeze({__proto__:null,FilmStripModel:class{#Ve;#El;#Al;constructor(e,t){this.#Ve=[],this.#El=0,this.#Al=0,this.reset(e,t)}hasFrames(){return this.#Ve.length>0}reset(e,t){this.#El=t||e.minimumRecordTime(),this.#Al=e.maximumRecordTime()-this.#El,this.#Ve=[];const n=ri.browserMainThread(e);if(!n)return;const r=n.events();for(let e=0;e<r.length;++e){const t=r[e];t.startTime<this.#El||t.hasCategory(ki)&&t.name===Si.Screenshot&&this.#Ve.push(wi.fromSnapshot(this,t,this.#Ve.length))}}frames(){return this.#Ve}zeroTime(){return this.#El}spanTime(){return this.#Al}frameByTimestamp(e){const n=t.ArrayUtilities.nearestIndexFromEnd(this.#Ve,(t=>t.timestamp<e));return null===n?null:this.#Ve[n]}},Frame:wi}),Ti=Object.freeze({__proto__:null});let Ri;class xi extends e.ObjectWrapper.ObjectWrapper{#Ol;#Nl;#D;#Fl;constructor(){super(),this.#Ol=new Map,this.#Nl=new Map,this.#D=new Set,K.instance().observeModels(Cr,this),this.#Fl=0}static instance({forceNew:e}={forceNew:!1}){return Ri&&!e||(Ri=new xi),Ri}observeIsolates(e){if(this.#D.has(e))throw new Error("Observer can only be registered once");this.#D.size||this.poll(),this.#D.add(e);for(const t of this.#Ol.values())e.isolateAdded(t)}unobserveIsolates(e){this.#D.delete(e),this.#D.size||++this.#Fl}modelAdded(e){this.modelAddedInternal(e)}async modelAddedInternal(e){this.#Nl.set(e,null);const t=await e.isolateId();if(!this.#Nl.has(e))return;if(!t)return void this.#Nl.delete(e);this.#Nl.set(e,t);let n=this.#Ol.get(t);if(n||(n=new Li(t),this.#Ol.set(t,n)),n.modelsInternal.add(e),1===n.modelsInternal.size)for(const e of this.#D)e.isolateAdded(n);else for(const e of this.#D)e.isolateChanged(n)}modelRemoved(e){const t=this.#Nl.get(e);if(this.#Nl.delete(e),!t)return;const n=this.#Ol.get(t);if(n)if(n.modelsInternal.delete(e),n.modelsInternal.size)for(const e of this.#D)e.isolateChanged(n);else{for(const e of this.#D)e.isolateRemoved(n);this.#Ol.delete(t)}}isolateByModel(e){return this.#Ol.get(this.#Nl.get(e)||"")||null}isolates(){return this.#Ol.values()}async poll(){const e=this.#Fl;for(;e===this.#Fl;)await Promise.all(Array.from(this.isolates(),(e=>e.update()))),await new Promise((e=>window.setTimeout(e,Pi)))}}var Mi;(Mi||(Mi={})).MemoryChanged="MemoryChanged";const Pi=2e3;class Li{#E;modelsInternal;#Bl;#Dl;constructor(e){this.#E=e,this.modelsInternal=new Set,this.#Bl=0;const t=12e4/Pi;this.#Dl=new Ei(t)}id(){return this.#E}models(){return this.modelsInternal}runtimeModel(){return this.modelsInternal.values().next().value||null}heapProfilerModel(){const e=this.runtimeModel();return e&&e.heapProfilerModel()}async update(){const e=this.runtimeModel(),t=e&&await e.heapUsage();t&&(this.#Bl=t.usedSize,this.#Dl.add(this.#Bl),xi.instance().dispatchEventToListeners(Mi.MemoryChanged,this))}samplesCount(){return this.#Dl.count()}usedHeapSize(){return this.#Bl}usedHeapSizeGrowRate(){return this.#Dl.fitSlope()}isMainThread(){const e=this.runtimeModel();return!!e&&"main"===e.target().id()}}class Ei{#Ul;#Hl;#Kr;#ql;#_l;#zl;#jl;#Wl;#Vl;constructor(e){this.#Ul=0|e,this.reset()}reset(){this.#Hl=Date.now(),this.#Kr=0,this.#ql=[],this.#_l=[],this.#zl=0,this.#jl=0,this.#Wl=0,this.#Vl=0}count(){return this.#ql.length}add(e,t){const n="number"==typeof t?t:Date.now()-this.#Hl,r=e;if(this.#ql.length===this.#Ul){const e=this.#ql[this.#Kr],t=this.#_l[this.#Kr];this.#zl-=e,this.#jl-=t,this.#Wl-=e*e,this.#Vl-=e*t}this.#zl+=n,this.#jl+=r,this.#Wl+=n*n,this.#Vl+=n*r,this.#ql[this.#Kr]=n,this.#_l[this.#Kr]=r,this.#Kr=(this.#Kr+1)%this.#Ul}fitSlope(){const e=this.count();return e<2?0:(this.#Vl-this.#zl*this.#jl/e)/(this.#Wl-this.#zl*this.#zl/e)}}var Ai=Object.freeze({__proto__:null,IsolateManager:xi,get Events(){return Mi},MemoryTrendWindowMs:12e4,Isolate:Li,MemoryTrend:Ei});class Oi extends c{#Gl=!1;#ma=!1;constructor(e){super(e),this.ensureEnabled()}async ensureEnabled(){if(this.#ma)return;this.#ma=!0,this.target().registerAuditsDispatcher(this);const e=this.target().auditsAgent();await e.invoke_enable()}issueAdded(e){this.dispatchEventToListeners("IssueAdded",{issuesModel:this,inspectorIssue:e.issue})}dispose(){super.dispose(),this.#Gl=!0}getTargetIfNotDisposed(){return this.#Gl?null:this.target()}}c.register(Oi,{capabilities:z.Audits,autostart:!0});var Ni,Fi=Object.freeze({__proto__:null,IssuesModel:Oi});!function(e){let t;!function(e){e.NonFastScrollable="NonFastScrollable",e.TouchEventHandler="TouchEventHandler",e.WheelEventHandler="WheelEventHandler",e.RepaintsOnScroll="RepaintsOnScroll",e.MainThreadScrollingReason="MainThreadScrollingReason"}(t=e.ScrollRectType||(e.ScrollRectType={}))}(Ni||(Ni={}));var Bi=Object.freeze({__proto__:null,get Layer(){return Ni},StickyPositionConstraint:class{#Kl;#$l;#Ql;#Xl;constructor(e,t){this.#Kl=t.stickyBoxRect,this.#$l=t.containingBlockRect,this.#Ql=null,e&&t.nearestLayerShiftingStickyBox&&(this.#Ql=e.layerById(t.nearestLayerShiftingStickyBox)),this.#Xl=null,e&&t.nearestLayerShiftingContainingBlock&&(this.#Xl=e.layerById(t.nearestLayerShiftingContainingBlock))}stickyBoxRect(){return this.#Kl}containingBlockRect(){return this.#$l}nearestLayerShiftingStickyBox(){return this.#Ql}nearestLayerShiftingContainingBlock(){return this.#Xl}},LayerTreeBase:class{#e;#Mr;layersById;#Jl;#Yl;#Zl;#ed;constructor(e){this.#e=e,this.#Mr=e?e.model(Pn):null,this.layersById=new Map,this.#Jl=null,this.#Yl=null,this.#Zl=new Map}target(){return this.#e}root(){return this.#Jl}setRoot(e){this.#Jl=e}contentRoot(){return this.#Yl}setContentRoot(e){this.#Yl=e}forEachLayer(e,t){return!(!t&&!(t=this.root()))&&(e(t)||t.children().some(this.forEachLayer.bind(this,e)))}layerById(e){return this.layersById.get(e)||null}async resolveBackendNodeIds(e){if(!e.size||!this.#Mr)return;const t=await this.#Mr.pushNodesByBackendIdsToFrontend(e);if(t)for(const e of t.keys())this.#Zl.set(e,t.get(e)||null)}backendNodeIdToNode(){return this.#Zl}setViewportSize(e){this.#ed=e}viewportSize(){return this.#ed}nodeForId(e){return this.#Mr?this.#Mr.nodeForId(e):null}}});class Di{id;url;startTime;loadTime;contentLoadTime;mainRequest;constructor(e){this.id=++Di.lastIdentifier,this.url=e.url(),this.startTime=e.startTime,this.mainRequest=e}static forRequest(e){return Ui.get(e)||null}bindRequest(e){Ui.set(e,this)}static lastIdentifier=0}const Ui=new WeakMap;var Hi=Object.freeze({__proto__:null,PageLoad:Di});class qi extends c{layerTreeAgent;constructor(e){super(e),this.layerTreeAgent=e.layerTreeAgent()}async loadSnapshotFromFragments(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_loadSnapshot({tiles:e});return t?new _i(this,t):null}loadSnapshot(e){const t={x:0,y:0,picture:e};return this.loadSnapshotFromFragments([t])}async makeSnapshot(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_makeSnapshot({layerId:e});return t?new _i(this,t):null}}class _i{#td;#nd;#rd;constructor(e,t){this.#td=e,this.#nd=t,this.#rd=1}release(){console.assert(this.#rd>0,"release is already called on the object"),--this.#rd||this.#td.layerTreeAgent.invoke_releaseSnapshot({snapshotId:this.#nd})}addReference(){++this.#rd,console.assert(this.#rd>0,"Referencing a dead object")}async replay(e,t,n){return(await this.#td.layerTreeAgent.invoke_replaySnapshot({snapshotId:this.#nd,fromStep:t,toStep:n,scale:e||1})).dataURL}async profile(e){return(await this.#td.layerTreeAgent.invoke_profileSnapshot({snapshotId:this.#nd,minRepeatCount:5,minDuration:1,clipRect:e||void 0})).timings}async commandLog(){const e=await this.#td.layerTreeAgent.invoke_snapshotCommandLog({snapshotId:this.#nd});return e.commandLog?e.commandLog.map(((e,t)=>new zi(e,t))):null}}class zi{method;params;commandIndex;constructor(e,t){this.method=e.method,this.params=e.params,this.commandIndex=t}}c.register(qi,{capabilities:z.DOM,autostart:!1});var ji=Object.freeze({__proto__:null,PaintProfilerModel:qi,PaintProfilerSnapshot:_i,PaintProfilerLogItem:zi});class Wi extends c{#Ts;#sd;#id;constructor(e){super(e),this.#Ts=e.performanceAgent(),this.#sd=new Map([["TaskDuration","CumulativeTime"],["ScriptDuration","CumulativeTime"],["LayoutDuration","CumulativeTime"],["RecalcStyleDuration","CumulativeTime"],["LayoutCount","CumulativeCount"],["RecalcStyleCount","CumulativeCount"]]),this.#id=new Map}enable(){return this.#Ts.invoke_enable({})}disable(){return this.#Ts.invoke_disable()}async requestMetrics(){const e=await this.#Ts.invoke_getMetrics()||[],n=new Map,r=performance.now();for(const s of e.metrics){let e,i=this.#id.get(s.name);switch(i||(i={lastValue:void 0,lastTimestamp:void 0},this.#id.set(s.name,i)),this.#sd.get(s.name)){case"CumulativeTime":e=i.lastTimestamp&&i.lastValue?t.NumberUtilities.clamp(1e3*(s.value-i.lastValue)/(r-i.lastTimestamp),0,1):0,i.lastValue=s.value,i.lastTimestamp=r;break;case"CumulativeCount":e=i.lastTimestamp&&i.lastValue?Math.max(0,1e3*(s.value-i.lastValue)/(r-i.lastTimestamp)):0,i.lastValue=s.value,i.lastTimestamp=r;break;default:e=s.value}n.set(s.name,e)}return{metrics:n,timestamp:r}}}c.register(Wi,{capabilities:z.DOM,autostart:!1});var Vi,Gi=Object.freeze({__proto__:null,PerformanceMetricsModel:Wi});class Ki extends c{agent;loaderIds=[];targetJustAttached=!0;lastPrimaryPageModel=null;documents=new Map;getFeatureFlagsPromise;constructor(e){super(e),e.registerPreloadDispatcher(new $i(this)),this.agent=e.preloadAgent(),this.agent.invoke_enable(),this.getFeatureFlagsPromise=this.getFeatureFlags();const t=e.targetInfo();void 0!==t&&"prerender"===t.subtype&&(this.lastPrimaryPageModel=K.instance().primaryPageTarget()?.model(Ki)||null),K.instance().addModelListener(jn,_n.PrimaryPageChanged,this.onPrimaryPageChanged,this)}dispose(){super.dispose(),K.instance().removeModelListener(jn,_n.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.agent.invoke_disable()}ensureDocumentPreloadingData(e){void 0===this.documents.get(e)&&this.documents.set(e,new Qi)}currentLoaderId(){if(this.targetJustAttached)return null;if(0===this.loaderIds.length)throw new Error("unreachable");return this.loaderIds[this.loaderIds.length-1]}currentDocument(){const e=this.currentLoaderId();return null===e?null:this.documents.get(e)||null}getRuleSetById(e){return this.currentDocument()?.ruleSets.getById(e)||null}getAllRuleSets(){return this.currentDocument()?.ruleSets.getAll()||[]}getPreloadingAttemptById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getById(e,t.sources)||null}getPreloadingAttempts(e){const t=this.currentDocument();return null===t?[]:t.preloadingAttempts.getAll(e,t.sources)}getPreloadingAttemptsOfPreviousPage(){if(this.loaderIds.length<=1)return[];const e=this.documents.get(this.loaderIds[this.loaderIds.length-2]);return void 0===e?[]:e.preloadingAttempts.getAll(null,e.sources)}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(null===this.lastPrimaryPageModel&&"Activation"===n)return;if(null!==this.lastPrimaryPageModel&&"Activation"!==n)return;if(null!==this.lastPrimaryPageModel&&"Activation"===n){this.loaderIds=this.lastPrimaryPageModel.loaderIds;for(const[e,t]of this.lastPrimaryPageModel.documents.entries())this.ensureDocumentPreloadingData(e),this.documents.get(e)?.mergePrevious(t)}this.lastPrimaryPageModel=null;const r=t.loaderId;this.loaderIds.push(r),this.loaderIds=this.loaderIds.slice(-2),this.ensureDocumentPreloadingData(r);for(const e of this.documents.keys())this.loaderIds.includes(e)||this.documents.delete(e);this.dispatchEventToListeners(Vi.ModelUpdated)}onRuleSetUpdated(e){const t=e.ruleSet,n=t.loaderId;null===this.currentLoaderId()&&(this.loaderIds=[n],this.targetJustAttached=!1),this.ensureDocumentPreloadingData(n),this.documents.get(n)?.ruleSets.upsert(t),this.dispatchEventToListeners(Vi.ModelUpdated)}onRuleSetRemoved(e){const t=e.id;for(const e of this.documents.values())e.ruleSets.delete(t);this.dispatchEventToListeners(Vi.ModelUpdated)}onPreloadingAttemptSourcesUpdated(e){const t=e.loaderId;this.ensureDocumentPreloadingData(t);const n=this.documents.get(t);void 0!==n&&(n.sources.update(e.preloadingAttemptSources),n.preloadingAttempts.maybeRegisterNotTriggered(n.sources),this.dispatchEventToListeners(Vi.ModelUpdated))}onPrefetchStatusUpdated(e){const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prefetch",key:e.key,status:Ji(e.status),prefetchStatus:e.prefetchStatus||null};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners(Vi.ModelUpdated)}onPrerenderStatusUpdated(e){const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prerender",key:e.key,status:Ji(e.status),prerenderStatus:e.prerenderStatus||null};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners(Vi.ModelUpdated)}async getFeatureFlags(){const e=this.target().systemInfo().invoke_getFeatureState({featureState:"PreloadingHoldback"}),t=this.target().systemInfo().invoke_getFeatureState({featureState:"PrerenderHoldback"});return{preloadingHoldback:(await e).featureEnabled,prerender2Holdback:(await t).featureEnabled}}async onPreloadEnabledStateUpdated(e){const t=await this.getFeatureFlagsPromise,n={featureFlagPreloadingHoldback:t.preloadingHoldback,featureFlagPrerender2Holdback:t.prerender2Holdback,...e};this.dispatchEventToListeners(Vi.WarningsUpdated,n)}}c.register(Ki,{capabilities:z.DOM,autostart:!1}),function(e){e.ModelUpdated="ModelUpdated",e.WarningsUpdated="WarningsUpdated"}(Vi||(Vi={}));class $i{model;constructor(e){this.model=e}ruleSetUpdated(e){this.model.onRuleSetUpdated(e)}ruleSetRemoved(e){this.model.onRuleSetRemoved(e)}preloadingAttemptSourcesUpdated(e){this.model.onPreloadingAttemptSourcesUpdated(e)}prefetchStatusUpdated(e){this.model.onPrefetchStatusUpdated(e)}prerenderAttemptCompleted(e){}prerenderStatusUpdated(e){this.model.onPrerenderStatusUpdated(e)}preloadEnabledStateUpdated(e){this.model.onPreloadEnabledStateUpdated(e)}}class Qi{ruleSets=new Xi;preloadingAttempts=new Zi;sources=new ea;mergePrevious(e){if(!this.ruleSets.isEmpty()||!this.sources.isEmpty())throw new Error("unreachable");this.ruleSets=e.ruleSets,this.preloadingAttempts.mergePrevious(e.preloadingAttempts),this.sources=e.sources}}class Xi{map=new Map;isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}getAll(){return Array.from(this.map.entries()).map((([e,t])=>({id:e,value:t})))}upsert(e){this.map.set(e.id,e)}delete(e){this.map.delete(e)}}function Ji(e){switch(e){case"Pending":return"Pending";case"Running":return"Running";case"Ready":return"Ready";case"Success":return"Success";case"Failure":return"Failure";case"NotSupported":return"NotSupported"}throw new Error("unreachable")}function Yi(e){let t,n;switch(e.action){case"Prefetch":t="Prefetch";break;case"Prerender":t="Prerender"}switch(e.targetHint){case void 0:n="undefined";break;case"Blank":n="Blank";break;case"Self":n="Self"}return`${e.loaderId}:${t}:${e.url}:${n}`}class Zi{map=new Map;enrich(e,t){let n=[],r=[];return null!==t&&(n=t.ruleSetIds,r=t.nodeIds),{...e,ruleSetIds:n,nodeIds:r}}getById(e,t){const n=this.map.get(e)||null;return null===n?null:this.enrich(n,t.getById(e))}getAll(e,t){return[...this.map.entries()].map((([e,n])=>({id:e,value:this.enrich(n,t.getById(e))}))).filter((({value:t})=>!e||t.ruleSetIds.includes(e)))}upsert(e){const t=Yi(e.key);this.map.set(t,e)}maybeRegisterNotTriggered(e){for(const[t,{key:n}]of e.entries()){if(void 0!==this.map.get(t))continue;let e;switch(n.action){case"Prefetch":e={action:"Prefetch",key:n,status:"NotTriggered",prefetchStatus:null};break;case"Prerender":e={action:"Prerender",key:n,status:"NotTriggered",prerenderStatus:null}}this.map.set(t,e)}}mergePrevious(e){for(const[t,n]of this.map.entries())e.map.set(t,n);this.map=e.map}}class ea{map=new Map;entries(){return this.map.entries()}isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}update(e){this.map=new Map(e.map((e=>[Yi(e.key),e])))}}var ta=Object.freeze({__proto__:null,PreloadingModel:Ki,get Events(){return Vi}});class na extends c{#Ts;#ad;#od;constructor(e){super(e),this.#Ts=e.pageAgent(),this.#ad=null,this.#od=null,e.registerPageDispatcher(this)}startScreencast(e,t,n,r,s,i,a){this.#ad=i,this.#od=a,this.#Ts.invoke_startScreencast({format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s})}stopScreencast(){this.#ad=null,this.#od=null,this.#Ts.invoke_stopScreencast()}async captureScreenshot(e,t,n,r){const s={format:e,quality:t,fromSurface:!0};switch(n){case"fromClip":s.captureBeyondViewport=!0,s.clip=r;break;case"fullpage":s.captureBeyondViewport=!0;break;case"fromViewport":s.captureBeyondViewport=!1;break;default:throw new Error("Unexpected or unspecified screnshotMode")}await vn.muteHighlight();const i=await this.#Ts.invoke_captureScreenshot(s);return await vn.unmuteHighlight(),i.data}async fetchLayoutMetrics(){const e=await this.#Ts.invoke_getLayoutMetrics();return e.getError()?null:{viewportX:e.cssVisualViewport.pageX,viewportY:e.cssVisualViewport.pageY,viewportScale:e.cssVisualViewport.scale,contentWidth:e.cssContentSize.width,contentHeight:e.cssContentSize.height}}screencastFrame({data:e,metadata:t,sessionId:n}){this.#Ts.invoke_screencastFrameAck({sessionId:n}),this.#ad&&this.#ad.call(null,e,t)}screencastVisibilityChanged({visible:e}){this.#od&&this.#od.call(null,e)}backForwardCacheNotUsed(e){}domContentEventFired(e){}loadEventFired(e){}lifecycleEvent(e){}navigatedWithinDocument(e){}frameAttached(e){}frameNavigated(e){}documentOpened(e){}frameDetached(e){}frameStartedLoading(e){}frameStoppedLoading(e){}frameRequestedNavigation(e){}frameScheduledNavigation(e){}frameClearedScheduledNavigation(e){}frameResized(){}javascriptDialogOpening(e){}javascriptDialogClosed(e){}interstitialShown(){}interstitialHidden(){}windowOpen(e){}fileChooserOpened(e){}compilationCacheProduced(e){}downloadWillBegin(e){}downloadProgress(){}prerenderAttemptCompleted(e){}prefetchStatusUpdated(e){}prerenderStatusUpdated(e){}}c.register(na,{capabilities:z.ScreenCapture,autostart:!1});var ra=Object.freeze({__proto__:null,ScreenCaptureModel:na});class sa extends c{enabled=!1;storageAgent;storageKeyManager;bucketsById=new Map;trackedStorageKeys=new Set;constructor(e){super(e),e.registerStorageDispatcher(this),this.storageAgent=e.storageAgent(),this.storageKeyManager=e.model(qn)}getBuckets(){return new Set(this.bucketsById.values())}getBucketsForStorageKey(e){const t=[...this.bucketsById.values()];return new Set(t.filter((({bucket:t})=>t.storageKey===e)))}getDefaultBucketForStorageKey(e){return[...this.bucketsById.values()].find((({bucket:t})=>t.storageKey===e&&void 0===t.name))??null}getBucketById(e){return this.bucketsById.get(e)??null}getBucketByName(e,t){if(!t)return this.getDefaultBucketForStorageKey(e);return[...this.bucketsById.values()].find((({bucket:n})=>n.storageKey===e&&n.name===t))??null}deleteBucket(e){this.storageAgent.invoke_deleteStorageBucket({bucket:e})}enable(){if(!this.enabled){if(this.storageKeyManager){this.storageKeyManager.addEventListener(Un.StorageKeyAdded,this.storageKeyAdded,this),this.storageKeyManager.addEventListener(Un.StorageKeyRemoved,this.storageKeyRemoved,this);for(const e of this.storageKeyManager.storageKeys())this.addStorageKey(e)}this.enabled=!0}}storageKeyAdded(e){this.addStorageKey(e.data)}storageKeyRemoved(e){this.removeStorageKey(e.data)}addStorageKey(e){if(this.trackedStorageKeys.has(e))throw new Error("Can't call addStorageKey for a storage key if it has already been added.");this.trackedStorageKeys.add(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!0})}removeStorageKey(e){if(!this.trackedStorageKeys.has(e))throw new Error("Can't call removeStorageKey for a storage key if it hasn't already been added.");const t=this.getBucketsForStorageKey(e);for(const e of t)this.bucketRemoved(e);this.trackedStorageKeys.delete(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!1})}bucketAdded(e){this.bucketsById.set(e.id,e),this.dispatchEventToListeners("BucketAdded",{model:this,bucketInfo:e})}bucketRemoved(e){this.bucketsById.delete(e.id),this.dispatchEventToListeners("BucketRemoved",{model:this,bucketInfo:e})}bucketChanged(e){this.dispatchEventToListeners("BucketChanged",{model:this,bucketInfo:e})}bucketInfosAreEqual(e,t){return e.bucket.storageKey===t.bucket.storageKey&&e.id===t.id&&e.bucket.name===t.bucket.name&&e.expiration===t.expiration&&e.quota===t.quota&&e.persistent===t.persistent&&e.durability===t.durability}storageBucketCreatedOrUpdated({bucketInfo:e}){const t=this.getBucketById(e.id);t?this.bucketInfosAreEqual(t,e)||this.bucketChanged(e):this.bucketAdded(e)}storageBucketDeleted({bucketId:e}){const t=this.getBucketById(e);if(!t)throw new Error(`Received an event that Storage Bucket '${e}' was deleted, but it wasn't in the StorageBucketsModel.`);this.bucketRemoved(t)}interestGroupAccessed(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}cacheStorageListUpdated(e){}cacheStorageContentUpdated(e){}sharedStorageAccessed(e){}}c.register(sa,{capabilities:z.Storage,autostart:!1});var ia=Object.freeze({__proto__:null,StorageBucketsModel:sa});const aa={serviceworkercacheagentError:"`ServiceWorkerCacheAgent` error deleting cache entry {PH1} in cache: {PH2}"},oa=s.i18n.registerUIStrings("core/sdk/ServiceWorkerCacheModel.ts",aa),la=s.i18n.getLocalizedString.bind(void 0,oa);class da extends c{cacheAgent;#ld;#dd;#cd=new Map;#hd=new Set;#ud=new Set;#gd=new e.Throttler.Throttler(2e3);#ma=!1;#pd=!1;constructor(e){super(e),e.registerStorageDispatcher(this),this.cacheAgent=e.cacheStorageAgent(),this.#ld=e.storageAgent(),this.#dd=e.model(sa)}enable(){if(!this.#ma){this.#dd.addEventListener("BucketAdded",this.storageBucketAdded,this),this.#dd.addEventListener("BucketRemoved",this.storageBucketRemoved,this);for(const e of this.#dd.getBuckets())this.addStorageBucket(e.bucket);this.#ma=!0}}clearForStorageKey(e){for(const[t,n]of this.#cd.entries())n.storageKey===e&&(this.#cd.delete(t),this.cacheRemoved(n));for(const t of this.#dd.getBucketsForStorageKey(e))this.loadCacheNames(t.bucket)}refreshCacheNames(){for(const e of this.#cd.values())this.cacheRemoved(e);this.#cd.clear();const e=this.#dd.getBuckets();for(const t of e)this.loadCacheNames(t.bucket)}async deleteCache(e){const t=await this.cacheAgent.invoke_deleteCache({cacheId:e.cacheId});t.getError()?console.error(`ServiceWorkerCacheAgent error deleting cache ${e.toString()}: ${t.getError()}`):(this.#cd.delete(e.cacheId),this.cacheRemoved(e))}async deleteCacheEntry(t,n){const r=await this.cacheAgent.invoke_deleteEntry({cacheId:t.cacheId,request:n});r.getError()&&e.Console.Console.instance().error(la(aa.serviceworkercacheagentError,{PH1:t.toString(),PH2:String(r.getError())}))}loadCacheData(e,t,n,r,s){this.requestEntries(e,t,n,r,s)}loadAllCacheData(e,t,n){this.requestAllEntries(e,t,n)}caches(){const e=new Array;for(const t of this.#cd.values())e.push(t);return e}dispose(){for(const e of this.#cd.values())this.cacheRemoved(e);this.#cd.clear(),this.#ma&&(this.#dd.removeEventListener("BucketAdded",this.storageBucketAdded,this),this.#dd.removeEventListener("BucketRemoved",this.storageBucketRemoved,this))}addStorageBucket(e){this.loadCacheNames(e),this.#hd.has(e.storageKey)||(this.#hd.add(e.storageKey),this.#ld.invoke_trackCacheStorageForStorageKey({storageKey:e.storageKey}))}removeStorageBucket(e){let t=0;for(const[n,r]of this.#cd.entries())e.storageKey===r.storageKey&&t++,r.inBucket(e)&&(t--,this.#cd.delete(n),this.cacheRemoved(r));0===t&&(this.#hd.delete(e.storageKey),this.#ld.invoke_untrackCacheStorageForStorageKey({storageKey:e.storageKey}))}async loadCacheNames(e){const t=await this.cacheAgent.invoke_requestCacheNames({storageBucket:e});t.getError()||this.updateCacheNames(e,t.caches)}updateCacheNames(e,t){const n=new Set,r=new Map,s=new Map;for(const e of t){const t=e.storageBucket??this.#dd.getDefaultBucketForStorageKey(e.storageKey)?.bucket;if(!t)continue;const s=new ha(this,t,e.cacheName,e.cacheId);n.add(s.cacheId),this.#cd.has(s.cacheId)||(r.set(s.cacheId,s),this.#cd.set(s.cacheId,s))}this.#cd.forEach((function(t){t.inBucket(e)&&!n.has(t.cacheId)&&(s.set(t.cacheId,t),this.#cd.delete(t.cacheId))}),this),r.forEach(this.cacheAdded,this),s.forEach(this.cacheRemoved,this)}storageBucketAdded({data:{bucketInfo:{bucket:e}}}){this.addStorageBucket(e)}storageBucketRemoved({data:{bucketInfo:{bucket:e}}}){this.removeStorageBucket(e)}cacheAdded(e){this.dispatchEventToListeners(ca.CacheAdded,{model:this,cache:e})}cacheRemoved(e){this.dispatchEventToListeners(ca.CacheRemoved,{model:this,cache:e})}async requestEntries(e,t,n,r,s){const i=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,skipCount:t,pageSize:n,pathFilter:r});i.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",i.getError()):s(i.cacheDataEntries,i.returnCount)}async requestAllEntries(e,t,n){const r=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,pathFilter:t});r.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",r.getError()):n(r.cacheDataEntries,r.returnCount)}cacheStorageListUpdated({bucketId:e}){const t=this.#dd.getBucketById(e)?.bucket;t&&(this.#ud.add(t),this.#gd.schedule((()=>{const e=Array.from(this.#ud,(e=>this.loadCacheNames(e)));return this.#ud.clear(),Promise.all(e)}),this.#pd))}cacheStorageContentUpdated({bucketId:e,cacheName:t}){const n=this.#dd.getBucketById(e)?.bucket;n&&this.dispatchEventToListeners(ca.CacheStorageContentUpdated,{storageBucket:n,cacheName:t})}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}interestGroupAccessed(e){}sharedStorageAccessed(e){}storageBucketCreatedOrUpdated(e){}storageBucketDeleted(e){}setThrottlerSchedulesAsSoonAsPossibleForTest(){this.#pd=!0}}var ca;!function(e){e.CacheAdded="CacheAdded",e.CacheRemoved="CacheRemoved",e.CacheStorageContentUpdated="CacheStorageContentUpdated"}(ca||(ca={}));class ha{#$r;storageKey;storageBucket;cacheName;cacheId;constructor(e,t,n,r){this.#$r=e,this.storageBucket=t,this.storageKey=t.storageKey,this.cacheName=n,this.cacheId=r}inBucket(e){return this.storageKey===e.storageKey&&this.storageBucket.name===e.name}equals(e){return this.cacheId===e.cacheId}toString(){return this.storageKey+this.cacheName}async requestCachedResponse(e,t){const n=await this.#$r.cacheAgent.invoke_requestCachedResponse({cacheId:this.cacheId,requestURL:e,requestHeaders:t});return n.getError()?null:n.response}}c.register(da,{capabilities:z.Storage,autostart:!1});var ua=Object.freeze({__proto__:null,ServiceWorkerCacheModel:da,get Events(){return ca},Cache:ha});const ga={running:"running",starting:"starting",stopped:"stopped",stopping:"stopping",activated:"activated",activating:"activating",installed:"installed",installing:"installing",new:"new",redundant:"redundant",sSS:"{PH1} #{PH2} ({PH3})"},pa=s.i18n.registerUIStrings("core/sdk/ServiceWorkerManager.ts",ga),ma=s.i18n.getLocalizedString.bind(void 0,pa),fa=s.i18n.getLazilyComputedLocalizedString.bind(void 0,pa);class ba extends c{#Ts;#md;#ma;#fd;serviceWorkerNetworkRequestsPanelStatus;constructor(t){super(t),t.registerServiceWorkerDispatcher(new va(this)),this.#Ts=t.serviceWorkerAgent(),this.#md=new Map,this.#ma=!1,this.enable(),this.#fd=e.Settings.Settings.instance().createSetting("serviceWorkerUpdateOnReload",!1),this.#fd.get()&&this.forceUpdateSettingChanged(),this.#fd.addChangeListener(this.forceUpdateSettingChanged,this),new wa(t,this),this.serviceWorkerNetworkRequestsPanelStatus={isOpen:!1,openedAt:0}}async enable(){this.#ma||(this.#ma=!0,await this.#Ts.invoke_enable())}async disable(){this.#ma&&(this.#ma=!1,this.#md.clear(),await this.#Ts.invoke_enable())}registrations(){return this.#md}hasRegistrationForURLs(e){for(const t of this.#md.values())if(e.filter((e=>e&&e.startsWith(t.scopeURL))).length===e.length)return!0;return!1}findVersion(e){for(const t of this.registrations().values()){const n=t.versions.get(e);if(n)return n}return null}deleteRegistration(e){const t=this.#md.get(e);if(t){if(t.isRedundant())return this.#md.delete(e),void this.dispatchEventToListeners(ya.RegistrationDeleted,t);t.deleting=!0;for(const e of t.versions.values())this.stopWorker(e.id);this.unregister(t.scopeURL)}}async updateRegistration(e){const t=this.#md.get(e);t&&await this.#Ts.invoke_updateRegistration({scopeURL:t.scopeURL})}async deliverPushMessage(t,n){const r=this.#md.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ts.invoke_deliverPushMessage({origin:s,registrationId:t,data:n})}async dispatchSyncEvent(t,n,r){const s=this.#md.get(t);if(!s)return;const i=e.ParsedURL.ParsedURL.extractOrigin(s.scopeURL);await this.#Ts.invoke_dispatchSyncEvent({origin:i,registrationId:t,tag:n,lastChance:r})}async dispatchPeriodicSyncEvent(t,n){const r=this.#md.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ts.invoke_dispatchPeriodicSyncEvent({origin:s,registrationId:t,tag:n})}async unregister(e){await this.#Ts.invoke_unregister({scopeURL:e})}async startWorker(e){await this.#Ts.invoke_startWorker({scopeURL:e})}async skipWaiting(e){await this.#Ts.invoke_skipWaiting({scopeURL:e})}async stopWorker(e){await this.#Ts.invoke_stopWorker({versionId:e})}async inspectWorker(e){await this.#Ts.invoke_inspectWorker({versionId:e})}workerRegistrationUpdated(e){for(const t of e){let e=this.#md.get(t.registrationId);e?(e.update(t),e.shouldBeRemoved()?(this.#md.delete(e.id),this.dispatchEventToListeners(ya.RegistrationDeleted,e)):this.dispatchEventToListeners(ya.RegistrationUpdated,e)):(e=new Sa(t),this.#md.set(t.registrationId,e),this.dispatchEventToListeners(ya.RegistrationUpdated,e))}}workerVersionUpdated(e){const t=new Set;for(const n of e){const e=this.#md.get(n.registrationId);e&&(e.updateVersion(n),t.add(e))}for(const e of t)e.shouldBeRemoved()?(this.#md.delete(e.id),this.dispatchEventToListeners(ya.RegistrationDeleted,e)):this.dispatchEventToListeners(ya.RegistrationUpdated,e)}workerErrorReported(e){const t=this.#md.get(e.registrationId);t&&(t.errors.push(e),this.dispatchEventToListeners(ya.RegistrationErrorAdded,{registration:t,error:e}))}forceUpdateOnReloadSetting(){return this.#fd}forceUpdateSettingChanged(){const e=this.#fd.get();this.#Ts.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e})}}var ya;!function(e){e.RegistrationUpdated="RegistrationUpdated",e.RegistrationErrorAdded="RegistrationErrorAdded",e.RegistrationDeleted="RegistrationDeleted"}(ya||(ya={}));class va{#$;constructor(e){this.#$=e}workerRegistrationUpdated({registrations:e}){this.#$.workerRegistrationUpdated(e)}workerVersionUpdated({versions:e}){this.#$.workerVersionUpdated(e)}workerErrorReported({errorMessage:e}){this.#$.workerErrorReported(e)}}class Ia{runningStatus;status;last_updated_timestamp;previousState;constructor(e,t,n,r){this.runningStatus=e,this.status=t,this.last_updated_timestamp=r,this.previousState=n}}class ka{id;scriptURL;parsedURL;securityOrigin;scriptLastModified;scriptResponseTime;controlledClients;targetId;currentState;registration;constructor(e,t){this.registration=e,this.update(t)}update(t){this.id=t.versionId,this.scriptURL=t.scriptURL;const n=new e.ParsedURL.ParsedURL(t.scriptURL);this.securityOrigin=n.securityOrigin(),this.currentState=new Ia(t.runningStatus,t.status,this.currentState,Date.now()),this.scriptLastModified=t.scriptLastModified,this.scriptResponseTime=t.scriptResponseTime,t.controlledClients?this.controlledClients=t.controlledClients.slice():this.controlledClients=[],this.targetId=t.targetId||null}isStartable(){return!this.registration.isDeleted&&this.isActivated()&&this.isStopped()}isStoppedAndRedundant(){return"stopped"===this.runningStatus&&"redundant"===this.status}isStopped(){return"stopped"===this.runningStatus}isStarting(){return"starting"===this.runningStatus}isRunning(){return"running"===this.runningStatus}isStopping(){return"stopping"===this.runningStatus}isNew(){return"new"===this.status}isInstalling(){return"installing"===this.status}isInstalled(){return"installed"===this.status}isActivating(){return"activating"===this.status}isActivated(){return"activated"===this.status}isRedundant(){return"redundant"===this.status}get status(){return this.currentState.status}get runningStatus(){return this.currentState.runningStatus}mode(){return this.isNew()||this.isInstalling()?ka.Modes.Installing:this.isInstalled()?ka.Modes.Waiting:this.isActivating()||this.isActivated()?ka.Modes.Active:ka.Modes.Redundant}}!function(e){let t;e.RunningStatus={running:fa(ga.running),starting:fa(ga.starting),stopped:fa(ga.stopped),stopping:fa(ga.stopping)},e.Status={activated:fa(ga.activated),activating:fa(ga.activating),installed:fa(ga.installed),installing:fa(ga.installing),new:fa(ga.new),redundant:fa(ga.redundant)},function(e){e.Installing="installing",e.Waiting="waiting",e.Active="active",e.Redundant="redundant"}(t=e.Modes||(e.Modes={}))}(ka||(ka={}));class Sa{#bd;id;scopeURL;securityOrigin;isDeleted;versions;deleting;errors;constructor(e){this.update(e),this.versions=new Map,this.deleting=!1,this.errors=[]}update(t){this.#bd=Symbol("fingerprint"),this.id=t.registrationId,this.scopeURL=t.scopeURL;const n=new e.ParsedURL.ParsedURL(t.scopeURL);this.securityOrigin=n.securityOrigin(),this.isDeleted=t.isDeleted}fingerprint(){return this.#bd}versionsByMode(){const e=new Map;for(const t of this.versions.values())e.set(t.mode(),t);return e}updateVersion(e){this.#bd=Symbol("fingerprint");let t=this.versions.get(e.versionId);return t?(t.update(e),t):(t=new ka(this,e),this.versions.set(e.versionId,t),t)}isRedundant(){for(const e of this.versions.values())if(!e.isStoppedAndRedundant())return!1;return!0}shouldBeRemoved(){return this.isRedundant()&&(!this.errors.length||this.deleting)}canBeRemoved(){return this.isDeleted||this.deleting}clearErrors(){this.#bd=Symbol("fingerprint"),this.errors=[]}}class wa{#h;#yd;#vd;constructor(e,t){this.#h=e,this.#yd=t,this.#vd=new Map,t.addEventListener(ya.RegistrationUpdated,this.registrationsUpdated,this),t.addEventListener(ya.RegistrationDeleted,this.registrationsUpdated,this),K.instance().addModelListener(Cr,Rr.ExecutionContextCreated,this.executionContextCreated,this)}registrationsUpdated(){this.#vd.clear();const e=this.#yd.registrations().values();for(const t of e)for(const e of t.versions.values())e.targetId&&this.#vd.set(e.targetId,e);this.updateAllContextLabels()}executionContextCreated(e){const t=e.data,n=this.serviceWorkerTargetId(t.target());n&&this.updateContextLabel(t,this.#vd.get(n)||null)}serviceWorkerTargetId(e){return e.parentTarget()!==this.#h||e.type()!==_.ServiceWorker?null:e.id()}updateAllContextLabels(){for(const e of K.instance().targets()){const t=this.serviceWorkerTargetId(e);if(!t)continue;const n=this.#vd.get(t)||null,r=e.model(Cr),s=r?r.executionContexts():[];for(const e of s)this.updateContextLabel(e,n)}}updateContextLabel(t,n){if(!n)return void t.setLabel("");const r=e.ParsedURL.ParsedURL.fromString(t.origin),s=r?r.lastPathComponentWithFragment():t.name,i=ka.Status[n.status];t.setLabel(ma(ga.sSS,{PH1:s,PH2:n.id,PH3:i()}))}}c.register(ba,{capabilities:z.ServiceWorker,autostart:!0});var Ca=Object.freeze({__proto__:null,ServiceWorkerManager:ba,get Events(){return ya},ServiceWorkerVersionState:Ia,get ServiceWorkerVersion(){return ka},ServiceWorkerRegistration:Sa});const Ta=new Map,Ra=new Map;async function xa(e,t){const n=Ta.get(e)?.get(t);if(void 0!==n)return n;const r=K.instance().primaryPageTarget()?.model(Pn);if(!r)return null;const s=(await r.pushNodesByBackendIdsToFrontend(new Set([t])))?.get(t)||null,i=Ta.get(e)||new Map;return i.set(t,s),Ta.set(e,i),s}const Ma=new Map,Pa=new Map;var La=Object.freeze({__proto__:null,_TEST_clearCache:function(){Ta.clear(),Ra.clear(),Ma.clear(),Pa.clear()},domNodeForBackendNodeID:xa,domNodesForMultipleBackendNodeIds:async function(e,t){const n=Ra.get(e)?.get(t);if(n)return n;const r=K.instance().primaryPageTarget()?.model(Pn);if(!r)return new Map;const s=await r.pushNodesByBackendIdsToFrontend(t)||new Map,i=Ra.get(e)||new Map;return i.set(t,s),Ra.set(e,i),s},sourcesForLayoutShift:async function(e,t){const n=Ma.get(e)?.get(t);if(n)return n;const r=t.args.data?.impacted_nodes;if(!r)return[];const s=[];await Promise.all(r.map((async t=>{const n=await xa(e,t.node_id);n&&s.push({previousRect:new DOMRect(t.old_rect[0],t.old_rect[1],t.old_rect[2],t.old_rect[3]),currentRect:new DOMRect(t.new_rect[0],t.new_rect[1],t.new_rect[2],t.new_rect[3]),node:n})})));const i=Ma.get(e)||new Map;return i.set(t,s),Ma.set(e,i),s},normalizedImpactedNodesForLayoutShift:async function(e,t){const n=Pa.get(e)?.get(t);if(n)return n;const r=t.args?.data?.impacted_nodes;if(!r)return[];let s=null;const i=K.instance().primaryPageTarget(),a=await(i?.runtimeAgent().invoke_evaluate({expression:"window.devicePixelRatio"}));if("number"===a?.result.type&&(s=a?.result.value??null),!s)return r;const o=[];for(const e of r){const t={...e};for(let n=0;n<e.old_rect.length;n++)t.old_rect[n]/=s;for(let n=0;n<e.new_rect.length;n++)t.new_rect[n]/=s;o.push(t)}const l=Pa.get(e)||new Map;return l.set(t,o),Pa.set(e,l),o},getMetadataForFreshRecording:async function(e){try{const t=Ts.instance().hasPrimaryPageTargetSet()?await Promise.race([Ts.instance().getHardwareConcurrency(),new Promise((e=>{setTimeout((()=>e(void 0)),1e3)}))]):void 0,n=Ts.instance().cpuThrottlingRate(),r=ue.instance().networkConditions(),s="function"==typeof r.title?r.title():r.title;return{source:"DevTools",startTime:e?new Date(e).toJSON():void 0,cpuThrottling:n,networkThrottling:s,hardwareConcurrency:t}}catch{return}}});class Ea extends c{#Id;#kd;#Sd;#wd;#Cd;constructor(e){super(e),this.#Id=e.tracingAgent(),e.registerTracingDispatcher(new Aa(this)),this.#kd=null,this.#Sd=0,this.#wd=0}bufferUsage(e,t,n){this.#Sd=void 0===t?null:t,this.#kd&&this.#kd.tracingBufferUsage(e||n||0)}eventsCollected(e){this.#kd&&(this.#kd.traceEventsCollected(e),this.#wd+=e.length,this.#Sd?(this.#wd>this.#Sd&&(this.#wd=this.#Sd),this.#kd.eventsRetrievalProgress(this.#wd/this.#Sd)):this.#kd.eventsRetrievalProgress(0))}tracingComplete(){this.#Sd=0,this.#wd=0,this.#kd&&(this.#kd.tracingComplete(),this.#kd=null),this.#Cd=!1}async start(e,t,n){if(this.#kd)throw new Error("Tracing is already started");this.#kd=e;const r={bufferUsageReportingInterval:500,categories:t,options:n,transferMode:"ReportEvents"},s=await this.#Id.invoke_start(r);return s.getError()&&(this.#kd=null),s}stop(){if(!this.#kd)throw new Error("Tracing is not started");if(this.#Cd)throw new Error("Tracing is already being stopped");this.#Cd=!0,this.#Id.invoke_end()}}class Aa{#Td;constructor(e){this.#Td=e}bufferUsage({value:e,eventCount:t,percentFull:n}){this.#Td.bufferUsage(e,t,n)}dataCollected({value:e}){this.#Td.eventsCollected(e)}tracingComplete(){this.#Td.tracingComplete()}}c.register(Ea,{capabilities:z.Tracing,autostart:!1});var Oa=Object.freeze({__proto__:null,TracingManager:Ea});class Na extends c{#Ts;constructor(e){super(e),this.#Ts=e.webAuthnAgent(),e.registerWebAuthnDispatcher(new Fa(this))}setVirtualAuthEnvEnabled(e){return e?this.#Ts.invoke_enable({enableUI:!0}):this.#Ts.invoke_disable()}async addAuthenticator(e){return(await this.#Ts.invoke_addVirtualAuthenticator({options:e})).authenticatorId}async removeAuthenticator(e){await this.#Ts.invoke_removeVirtualAuthenticator({authenticatorId:e})}async setAutomaticPresenceSimulation(e,t){await this.#Ts.invoke_setAutomaticPresenceSimulation({authenticatorId:e,enabled:t})}async getCredentials(e){return(await this.#Ts.invoke_getCredentials({authenticatorId:e})).credentials}async removeCredential(e,t){await this.#Ts.invoke_removeCredential({authenticatorId:e,credentialId:t})}credentialAdded(e){this.dispatchEventToListeners("CredentialAdded",e)}credentialAsserted(e){this.dispatchEventToListeners("CredentialAsserted",e)}}class Fa{#$r;constructor(e){this.#$r=e}credentialAdded(e){this.#$r.credentialAdded(e)}credentialAsserted(e){this.#$r.credentialAsserted(e)}}c.register(Na,{capabilities:z.WebAuthn,autostart:!1});var Ba=Object.freeze({__proto__:null,WebAuthnModel:Na});export{Nr as AccessibilityModel,vs as CPUProfileDataModel,ss as CPUProfilerModel,Ms as CPUThrottlingManager,Qe as CSSContainerQuery,ze as CSSFontFace,Je as CSSLayer,wt as CSSMatchedStyles,tt as CSSMedia,E as CSSMetadata,hn as CSSModel,lt as CSSProperty,Fs as CSSPropertyParser,We as CSSQuery,yt as CSSRule,rt as CSSScope,ct as CSSStyleDeclaration,Mt as CSSStyleSheetHeader,it as CSSSupports,Br as CategorizedBreakpoint,Vr as ChildTargetManager,Jr as CompilerSourceMappingContentProvider,jr as Connections,ms as ConsoleModel,U as Cookie,bs as CookieModel,j as CookieParser,$s as DOMDebuggerModel,On as DOMModel,Ir as DebuggerModel,ws as EmulationModel,ni as EventBreakpointsModel,Ci as FilmStripModel,Ti as FrameAssociated,At as FrameManager,wr as HeapProfilerModel,Nt as IOModel,Ai as IsolateManager,Fi as IssuesModel,Bi as LayerTreeBase,as as LogModel,me as NetworkManager,Pe as NetworkRequest,gn as OverlayColorGenerator,Cn as OverlayModel,mn as OverlayPersistentHighlighter,Hi as PageLoad,zt as PageResourceLoader,ji as PaintProfiler,Gi as PerformanceMetricsModel,ta as PreloadingModel,N as ProfileTreeModel,qe as RemoteObject,Bn as Resource,Kn as ResourceTreeModel,Er as RuntimeModel,h as SDKModel,ra as ScreenCaptureModel,tr as Script,Hn as SecurityOriginManager,Ie as ServerTiming,ua as ServiceWorkerCacheModel,Ca as ServiceWorkerManager,Xt as SourceMap,Zt as SourceMapManager,ia as StorageBucketsModel,zn as StorageKeyManager,V as Target,Q as TargetManager,La as TraceSDKServices,Oa as TracingManager,Ii as TracingModel,Ba as WebAuthnModel};
